ObjectInputStream.java (readFields): Use long datatype when shifting byte values...
authorMichael Koch <konqueror@gmx.de>
Fri, 9 Jul 2004 15:37:31 +0000 (15:37 +0000)
committerMichael Koch <mkoch@gcc.gnu.org>
Fri, 9 Jul 2004 15:37:31 +0000 (15:37 +0000)
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.

From-SVN: r84382

libjava/ChangeLog
libjava/java/io/ObjectInputStream.java

index d78d2734db7d30ba6598cca9d440d33d8448d0e3..b7eea9697b9bd0e83f79cc283cf3285905834394 100644 (file)
@@ -1,3 +1,8 @@
+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.
+
 2004-07-09  Michael Koch  <konqueror@gmx.de>
 
        * java/util/zip/DeflaterOutputStream.java,
index 292f841a65795377a9acf24f8e81e00d3def36ce..809e9b1c94120be4ed46384cb62643a1c3c01d7c 100644 (file)
@@ -1332,10 +1332,10 @@ public class ObjectInputStream extends InputStream
 
          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 @@ public class ObjectInputStream extends InputStream
          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)