X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=libjava%2Fclasspath%2Fjava%2Fio%2FPrintStream.java;h=caa6035cfcd2ef163a000a4bef2e20d75ab00b34;hb=4d8cd3a26294ce35abb17668eac2b6c38dd23bd0;hp=eaab7c3d4b58372cb63f494e6f862febfb532655;hpb=c944d49b3bd3667c65c299afd3b1d756084203f4;p=platform%2Fupstream%2Fgcc48.git
diff --git a/libjava/classpath/java/io/PrintStream.java b/libjava/classpath/java/io/PrintStream.java
index eaab7c3..caa6035 100644
--- a/libjava/classpath/java/io/PrintStream.java
+++ b/libjava/classpath/java/io/PrintStream.java
@@ -181,10 +181,15 @@ public class PrintStream extends FilterOutputStream implements Appendable
* @param out The OutputStream
to write to.
* @param auto_flush true
to flush the stream after every
* line, false
otherwise
+ * @exception NullPointerException If out is null.
*/
public PrintStream (OutputStream out, boolean auto_flush)
{
super (out);
+
+ if (out == null)
+ throw new NullPointerException("out is null");
+
String encoding;
try {
encoding = SystemProperties.getProperty("file.encoding");
@@ -213,12 +218,19 @@ public class PrintStream extends FilterOutputStream implements Appendable
* line, false
otherwise
* @param encoding The name of the character encoding to use for this
* object.
+ * @exception NullPointerException If out or encoding is null.
*/
public PrintStream (OutputStream out, boolean auto_flush, String encoding)
throws UnsupportedEncodingException
{
super (out);
+ if (out == null)
+ throw new NullPointerException("out is null");
+
+ if (encoding == null)
+ throw new NullPointerException("encoding is null");
+
new String(new byte[]{0}, encoding); // check if encoding is supported
this.encoding = encoding;
this.auto_flush = auto_flush;