This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: java.io.ObjectInputStream


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi list,


I just commited the attached patch to trunk to merge a fix I did for 
classpath some time ago.


Michael


2004-07-09  Michael Koch  <konqueror@gmx.de>

	* java/io/ObjectInputStream.java (readFields): Use long datatype
	when shifting byte values more then 24 bits left.
- -- 
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFA7rzjWSOgCCdjSDsRAv4qAJ9aBb0qa9s0X3hWF8G3vJd7W8W0tACcCMHr
lzuo0VrQ6I6fWIOZddaCmzU=
=LpGw
-----END PGP SIGNATURE-----
Index: java/io/ObjectInputStream.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/io/ObjectInputStream.java,v
retrieving revision 1.32
diff -u -b -B -r1.32 ObjectInputStream.java
--- java/io/ObjectInputStream.java	21 Jun 2004 16:52:14 -0000	1.32
+++ java/io/ObjectInputStream.java	9 Jul 2004 15:37:19 -0000
@@ -1332,10 +1332,10 @@
 
 	  int off = field.getOffset();
 
-	  return (long)(((prim_field_data[off++] & 0xFF) << 56)
-			| ((prim_field_data[off++] & 0xFF) << 48)
-			| ((prim_field_data[off++] & 0xFF) << 40)
-			| ((prim_field_data[off++] & 0xFF) << 32)
+	  return (long)(((prim_field_data[off++] & 0xFFL) << 56)
+			| ((prim_field_data[off++] & 0xFFL) << 48)
+			| ((prim_field_data[off++] & 0xFFL) << 40)
+			| ((prim_field_data[off++] & 0xFFL) << 32)
 			| ((prim_field_data[off++] & 0xFF) << 24)
 			| ((prim_field_data[off++] & 0xFF) << 16)
 			| ((prim_field_data[off++] & 0xFF) << 8)
@@ -1369,10 +1369,10 @@
 	  int off = field.getOffset();
 
 	  return Double.longBitsToDouble
-	    ( (long) (((prim_field_data[off++] & 0xFF) << 56)
-		      | ((prim_field_data[off++] & 0xFF) << 48)
-		      | ((prim_field_data[off++] & 0xFF) << 40)
-		      | ((prim_field_data[off++] & 0xFF) << 32)
+	    ( (long) (((prim_field_data[off++] & 0xFFL) << 56)
+		      | ((prim_field_data[off++] & 0xFFL) << 48)
+		      | ((prim_field_data[off++] & 0xFFL) << 40)
+		      | ((prim_field_data[off++] & 0xFFL) << 32)
 		      | ((prim_field_data[off++] & 0xFF) << 24)
 		      | ((prim_field_data[off++] & 0xFF) << 16)
 		      | ((prim_field_data[off++] & 0xFF) << 8)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]