public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/18840] New: java.io.BufferedInputStream.read(byte[],..) methods don't attempt to read as much as possible
@ 2004-12-05  3:06 greenrd at greenrd dot org
  2004-12-05 16:03 ` [Bug libgcj/18840] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: greenrd at greenrd dot org @ 2004-12-05  3:06 UTC (permalink / raw)
  To: gcc-bugs

The Sun Javadoc for java.io.BufferedInputStream.read(byte[],int,int) in version
1.4.2 states:

" This method implements the general contract of the corresponding read method
of the InputStream class. As an additional convenience, it attempts to read as
many bytes as possible by repeatedly invoking the read method of the underlying
stream. This iterated read continues until one of the following conditions
becomes true:

    * The specified number of bytes have been read,
    * The read method of the underlying stream returns -1, indicating
end-of-file, or
    * The available method of the underlying stream returns zero, indicating
that further input requests would block."

However, the libgcj implementation does not do this iterated reading.

Code which assumes this behaviour (e.g. IBM's ICU4j) may fail.

This bug exists in mainline.

-- 
           Summary: java.io.BufferedInputStream.read(byte[],..) methods
                    don't attempt to read as much as possible
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libgcj
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: greenrd at greenrd dot org
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18840


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libgcj/18840] java.io.BufferedInputStream.read(byte[],..) methods don't attempt to read as much as possible
  2004-12-05  3:06 [Bug libgcj/18840] New: java.io.BufferedInputStream.read(byte[],..) methods don't attempt to read as much as possible greenrd at greenrd dot org
@ 2004-12-05 16:03 ` pinskia at gcc dot gnu dot org
  2004-12-07  3:27 ` greenrd at greenrd dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-05 16:03 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-05 16:03 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-12-05 16:03:15
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18840


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libgcj/18840] java.io.BufferedInputStream.read(byte[],..) methods don't attempt to read as much as possible
  2004-12-05  3:06 [Bug libgcj/18840] New: java.io.BufferedInputStream.read(byte[],..) methods don't attempt to read as much as possible greenrd at greenrd dot org
  2004-12-05 16:03 ` [Bug libgcj/18840] " pinskia at gcc dot gnu dot org
@ 2004-12-07  3:27 ` greenrd at greenrd dot org
  2005-01-11 17:39 ` tromey at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: greenrd at greenrd dot org @ 2004-12-07  3:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From greenrd at greenrd dot org  2004-12-07 03:27 -------
Appears to be already fixed in GNU classpath:
http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/java/io/BufferedInputStream.java.diff?r1=1.11&r2=1.12

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18840


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libgcj/18840] java.io.BufferedInputStream.read(byte[],..) methods don't attempt to read as much as possible
  2004-12-05  3:06 [Bug libgcj/18840] New: java.io.BufferedInputStream.read(byte[],..) methods don't attempt to read as much as possible greenrd at greenrd dot org
  2004-12-05 16:03 ` [Bug libgcj/18840] " pinskia at gcc dot gnu dot org
  2004-12-07  3:27 ` greenrd at greenrd dot org
@ 2005-01-11 17:39 ` tromey at gcc dot gnu dot org
  2005-01-11 20:05 ` cvs-commit at gcc dot gnu dot org
  2005-01-11 20:06 ` tromey at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: tromey at gcc dot gnu dot org @ 2005-01-11 17:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tromey at gcc dot gnu dot org  2005-01-11 17:39 -------
I'm testing a patch.
We can't just directly use the Classpath code here since
our InputStreamReader interacts with this class, and that
class can't easily be merged because it touches on charset
conversion.



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |tromey at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18840


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libgcj/18840] java.io.BufferedInputStream.read(byte[],..) methods don't attempt to read as much as possible
  2004-12-05  3:06 [Bug libgcj/18840] New: java.io.BufferedInputStream.read(byte[],..) methods don't attempt to read as much as possible greenrd at greenrd dot org
                   ` (2 preceding siblings ...)
  2005-01-11 17:39 ` tromey at gcc dot gnu dot org
@ 2005-01-11 20:05 ` cvs-commit at gcc dot gnu dot org
  2005-01-11 20:06 ` tromey at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-01-11 20:05 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-01-11 20:04 -------
Subject: Bug 18840

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	tromey@gcc.gnu.org	2005-01-11 20:04:33

Modified files:
	libjava        : ChangeLog 
	libjava/java/io: BufferedInputStream.java 

Log message:
	PR libgcj/18840:
	* java/io/BufferedInputStream.java (read): Repeatedly read to
	fill buffer.
	(refill): Change test to see if buffer must be grown.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&r1=1.3282&r2=1.3283
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/java/io/BufferedInputStream.java.diff?cvsroot=gcc&r1=1.10&r2=1.11



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18840


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libgcj/18840] java.io.BufferedInputStream.read(byte[],..) methods don't attempt to read as much as possible
  2004-12-05  3:06 [Bug libgcj/18840] New: java.io.BufferedInputStream.read(byte[],..) methods don't attempt to read as much as possible greenrd at greenrd dot org
                   ` (3 preceding siblings ...)
  2005-01-11 20:05 ` cvs-commit at gcc dot gnu dot org
@ 2005-01-11 20:06 ` tromey at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: tromey at gcc dot gnu dot org @ 2005-01-11 20:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tromey at gcc dot gnu dot org  2005-01-11 20:05 -------
Fix checked in


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.0.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18840


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-01-11 20:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-05  3:06 [Bug libgcj/18840] New: java.io.BufferedInputStream.read(byte[],..) methods don't attempt to read as much as possible greenrd at greenrd dot org
2004-12-05 16:03 ` [Bug libgcj/18840] " pinskia at gcc dot gnu dot org
2004-12-07  3:27 ` greenrd at greenrd dot org
2005-01-11 17:39 ` tromey at gcc dot gnu dot org
2005-01-11 20:05 ` cvs-commit at gcc dot gnu dot org
2005-01-11 20:06 ` tromey at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).