[OpenJDK 2D-Dev] [9] request for review: 8074954: ImageInputStreamImpl.readShort/readInt do not behave correctly at EOF

2015-03-20 Thread Andrew Brygin
Hello, could you please review a fix for CR 8074954? Bug: https://bugs.openjdk.java.net/browse/JDK-8074954 Webrev: http://cr.openjdk.java.net/~bae/8074954/9/webrev.00/ The problem happens if an input stream does not contain enough data to read a multi-byte type (as 4-bytes integer or 2-bytes

Re: [OpenJDK 2D-Dev] [9] request for review: 8074954: ImageInputStreamImpl.readShort/readInt do not behave correctly at EOF

2015-03-20 Thread Sergey Bylokhov
Hi, Andrew? Hi, Andrew. Should we update a readFully() also? * @exception java.io.EOFException if the stream reaches the end before * reading all the bytes. * @exception IOException if an I/O error occurs. */ void readFully(byte[] b, int off, int len) throws IOException; 2

Re: [OpenJDK 2D-Dev] [9] request for review: 8074954: ImageInputStreamImpl.readShort/readInt do not behave correctly at EOF

2015-03-20 Thread Phil Race
Andrew, The fix looks good to me. Sergey, are you asking for that text to be added ? Looks to me like its already there, so probably I am not following what you mean. -phil. On 03/20/2015 10:32 AM, Sergey Bylokhov wrote: Hi, Andrew? Hi, Andrew. Should we update a readFully() also? * @ex

Re: [OpenJDK 2D-Dev] [9] request for review: 8074954: ImageInputStreamImpl.readShort/readInt do not behave correctly at EOF

2015-03-20 Thread Sergey Bylokhov
Andrew, The fix looks good to me. Sergey, are you asking for that text to be added ? Looks to me like its already there, so probably I am not following what you mean. No, readFully() has this code: int nbytes = read(b, off, len); if (nbytes == -1) { thro

Re: [OpenJDK 2D-Dev] [9] request for review: 8074954: ImageInputStreamImpl.readShort/readInt do not behave correctly at EOF

2015-03-20 Thread Phil Race
I see. You were referring to the implementation. But your snippet doesn't show the loop which should handle this case properly : 350 while (len > 0) { 351 int nbytes = read(b, off, len); 352 if (nbytes == -1) { 353 throw new EOFException(); 35

Re: [OpenJDK 2D-Dev] [9] request for review: 8074954: ImageInputStreamImpl.readShort/readInt do not behave correctly at EOF

2015-03-20 Thread Sergey Bylokhov
Right. It will be thrown on the next iteration. The fix looks fine then. 20.03.15 20:56, Phil Race wrote: I see. You were referring to the implementation. But your snippet doesn't show the loop which should handle this case properly : 350 while (len > 0) { 351 int nbytes

Re: [OpenJDK 2D-Dev] RFR: 8035302: Eliminate dependency on sun.nio.cs from AWT and Motif code

2015-03-20 Thread Phil Race
On 3/19/15 8:19 PM, Mandy Chung wrote: On 03/16/2015 02:32 PM, Phil Race wrote: Here is an updated fix that instead of removing the sun.nio dependency instead removes the jdk.charsets static dependency. From the internal API point of view its sun.nio.cs.ext that is the issue, not sun.nio ht