[Bug classpath/26312] New: ChunkedInputStream..read() returns incorrect values.

2006-02-15 Thread daney at gcc dot gnu dot org
Look at the code below, if the high bit in the byte is set read returns a
negitive number.  The is clearly in violation of the specification which says
the value must be between 0 - 255.


85 : public int read() 
86 :   throws IOException 
87 : { 
88 :   byte[] buf = new byte[1]; 
89 :   int len = read(buf, 0, 1); 
90 :   if (len == -1) 
91 : { 
92 :   return -1; 
93 : } 
94 :   int ret = (int) buf[0]; 
95 :   if (ret  0) 
96 : { 
97 :   ret += 0x100; 
98 : } 
99 :   return ret; 
100 : } 

Lines 94-99 should be replaced with: return 0xff  buf[0];


-- 
   Summary: ChunkedInputStream..read() returns incorrect values.
   Product: classpath
   Version: unspecified
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: classpath
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: daney at gcc dot gnu dot org
 GCC build triplet: *-*-*
  GCC host triplet: *-*-*
GCC target triplet: *-*-*


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



___
Bug-classpath mailing list
Bug-classpath@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-classpath


[Bug classpath/25851] HttpURLConnection.getRequestProperties() returns Strings for values instead of List.

2006-01-18 Thread daney at gcc dot gnu dot org


--- Comment #1 from daney at gcc dot gnu dot org  2006-01-19 00:01 ---
Should probably add that getRequestProperties() returns a Map.  The Map values
should be read-only lists of Strings.  Current the Map values are Strings.


-- 


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



___
Bug-classpath mailing list
Bug-classpath@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-classpath