diff --git a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/InputStreamReader.java b/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/InputStreamReader.java index bb76cdce5f..d388621e4a 100644 --- a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/InputStreamReader.java +++ b/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/InputStreamReader.java @@ -69,8 +69,7 @@ public class InputStreamReader extends Reader { * @param in An InputStream */ public InputStreamReader(InputStream in) { - super(in); - sd = StreamDecoder.forInputStreamReader(in, this, + sd = StreamDecoder.forInputStreamReader(in, this.lock, Charset.defaultCharset()); // ## check lock object } @@ -90,10 +89,9 @@ public InputStreamReader(InputStream in) { public InputStreamReader(InputStream in, String charsetName) throws UnsupportedEncodingException { - super(in); if (charsetName == null) throw new NullPointerException("charsetName"); - sd = StreamDecoder.forInputStreamReader(in, this, charsetName); + sd = StreamDecoder.forInputStreamReader(in, this.lock, charsetName); } /** @@ -106,10 +104,9 @@ public InputStreamReader(InputStream in, String charsetName) * @spec JSR-51 */ public InputStreamReader(InputStream in, Charset cs) { - super(in); if (cs == null) throw new NullPointerException("charset"); - sd = StreamDecoder.forInputStreamReader(in, this, cs); + sd = StreamDecoder.forInputStreamReader(in, this.lock, cs); } /** @@ -122,10 +119,9 @@ public InputStreamReader(InputStream in, Charset cs) { * @spec JSR-51 */ public InputStreamReader(InputStream in, CharsetDecoder dec) { - super(in); if (dec == null) throw new NullPointerException("charset decoder"); - sd = StreamDecoder.forInputStreamReader(in, this, dec); + sd = StreamDecoder.forInputStreamReader(in, this.lock, dec); } /** diff --git a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/OutputStreamWriter.java b/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/OutputStreamWriter.java index 5f7b9e34bc..e88e81ac1d 100644 --- a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/OutputStreamWriter.java +++ b/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/OutputStreamWriter.java @@ -97,7 +97,7 @@ public OutputStreamWriter(OutputStream out, String charsetName) super(out); if (charsetName == null) throw new NullPointerException("charsetName"); - se = StreamEncoder.forOutputStreamWriter(out, this, charsetName); + se = StreamEncoder.forOutputStreamWriter(out, this.lock, charsetName); } /** @@ -108,7 +108,7 @@ public OutputStreamWriter(OutputStream out, String charsetName) public OutputStreamWriter(OutputStream out) { super(out); try { - se = StreamEncoder.forOutputStreamWriter(out, this, (String)null); + se = StreamEncoder.forOutputStreamWriter(out, this.lock, (String)null); } catch (UnsupportedEncodingException e) { throw new Error(e); } @@ -130,7 +130,7 @@ public OutputStreamWriter(OutputStream out, Charset cs) { super(out); if (cs == null) throw new NullPointerException("charset"); - se = StreamEncoder.forOutputStreamWriter(out, this, cs); + se = StreamEncoder.forOutputStreamWriter(out, this.lock, cs); } /** @@ -149,7 +149,7 @@ public OutputStreamWriter(OutputStream out, CharsetEncoder enc) { super(out); if (enc == null) throw new NullPointerException("charset encoder"); - se = StreamEncoder.forOutputStreamWriter(out, this, enc); + se = StreamEncoder.forOutputStreamWriter(out, this.lock, enc); } /** diff --git a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/nio/cs/StreamDecoder.java b/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/nio/cs/StreamDecoder.java index 0d469949ed..c9014539e1 100644 --- a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/nio/cs/StreamDecoder.java +++ b/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/nio/cs/StreamDecoder.java @@ -233,14 +233,14 @@ private static FileChannel getChannel(FileInputStream in) { private InputStream in; private ReadableByteChannel ch; - StreamDecoder(InputStream in, Object lock, Charset cs) { + private StreamDecoder(InputStream in, Object lock, Charset cs) { this(in, lock, cs.newDecoder() .onMalformedInput(CodingErrorAction.REPLACE) .onUnmappableCharacter(CodingErrorAction.REPLACE)); } - StreamDecoder(InputStream in, Object lock, CharsetDecoder dec) { + private StreamDecoder(InputStream in, Object lock, CharsetDecoder dec) { super(lock); this.cs = dec.charset(); this.decoder = dec; @@ -260,7 +260,7 @@ private static FileChannel getChannel(FileInputStream in) { bb.flip(); // So that bb is initially empty } - StreamDecoder(ReadableByteChannel ch, CharsetDecoder dec, int mbc) { + private StreamDecoder(ReadableByteChannel ch, CharsetDecoder dec, int mbc) { this.in = null; this.ch = ch; this.decoder = dec;