# HG changeset patch # User andrew # Date 1436927216 -3600 # Node ID e44f97ff92bd11878f789b0ea2265651bf200446 # Parent 177c0f0553e6c7c27db5c2d25f307c1879df612a# Parent 0c7c745caea100a7b89f16cdc9c79b2687431f6f Merge diff -r 177c0f0553e6 -r e44f97ff92bd .hgtags --- a/.hgtags Wed Jul 15 03:21:42 2015 +0100 +++ b/.hgtags Wed Jul 15 03:26:56 2015 +0100 @@ -637,3 +637,5 @@ 9d5c92264131bcac8d8a032c055080cf51b18202 icedtea-2.6pre23 e3445769412d69411988241bef34fd1d652a37d1 icedtea-2.6pre24 e3445769412d69411988241bef34fd1d652a37d1 icedtea-2.6.0 +02c5cee149d94496124f794b7ef89d860b8710ee jdk7u85-b00 +a1436e2c0aa8c35b4c738004d19549df54448621 jdk7u85-b01 diff -r 177c0f0553e6 -r e44f97ff92bd src/share/classes/com/sun/corba/se/impl/io/IIOPInputStream.java --- a/src/share/classes/com/sun/corba/se/impl/io/IIOPInputStream.java Wed Jul 15 03:21:42 2015 +0100 +++ b/src/share/classes/com/sun/corba/se/impl/io/IIOPInputStream.java Wed Jul 15 03:26:56 2015 +0100 @@ -2417,8 +2417,8 @@ private void throwAwayData(ValueMember[] fields, com.sun.org.omg.SendingContext.CodeBase sender) throws InvalidClassException, StreamCorruptedException, - ClassNotFoundException, IOException - { + ClassNotFoundException, IOException { + for (int i = 0; i < fields.length; ++i) { try { @@ -2553,8 +2553,7 @@ } - private static void setObjectField(Object o, Class c, String fieldName, Object v) - { + private static void setObjectField(Object o, Class c, String fieldName, Object v) { try { Field fld = c.getDeclaredField( fieldName ) ; Class fieldCl = fld.getType(); @@ -2564,9 +2563,15 @@ long key = bridge.objectFieldOffset( fld ) ; bridge.putObject( o, key, v ) ; } catch (Exception e) { - throw utilWrapper.errorSetObjectField( e, fieldName, - o.toString(), - v.toString() ) ; + if (o != null) { + throw utilWrapper.errorSetObjectField( e, fieldName, + o.toString(), + v.toString() ) ; + } else { + throw utilWrapper.errorSetObjectField( e, fieldName, + "null " + c.getName() + " object", + v.toString() ) ; + } } } @@ -2574,12 +2579,22 @@ { try { Field fld = c.getDeclaredField( fieldName ) ; - long key = bridge.objectFieldOffset( fld ) ; - bridge.putBoolean( o, key, v ) ; + if ((fld != null) && (fld.getType() == Boolean.TYPE)) { + long key = bridge.objectFieldOffset( fld ) ; + bridge.putBoolean( o, key, v ) ; + } else { + throw new InvalidObjectException("Field Type mismatch"); + } } catch (Exception e) { + if (o != null) { throw utilWrapper.errorSetBooleanField( e, fieldName, o.toString(), new Boolean(v) ) ; + } else { + throw utilWrapper.errorSetBooleanField( e, fieldName, + "null " + c.getName() + " object", + new Boolean(v) ) ; + } } } @@ -2587,12 +2602,22 @@ { try { Field fld = c.getDeclaredField( fieldName ) ; - long key = bridge.objectFieldOffset( fld ) ; - bridge.putByte( o, key, v ) ; + if ((fld != null) && (fld.getType() == Byte.TYPE)) { + long key = bridge.objectFieldOffset( fld ) ; + bridge.putByte( o, key, v ) ; + } else { + throw new InvalidObjectException("Field Type mismatch"); + } } catch (Exception e) { - throw utilWrapper.errorSetByteField( e, fieldName, - o.toString(), - new Byte(v) ) ; + if (o != null) { + throw utilWrapper.errorSetByteField( e, fieldName, + o.toString(), + new Byte(v) ) ; + } else { + throw utilWrapper.errorSetByteField( e, fieldName, + "null " + c.getName() + " object", + new Byte(v) ) ; + } } } @@ -2600,12 +2625,22 @@ { try { Field fld = c.getDeclaredField( fieldName ) ; - long key = bridge.objectFieldOffset( fld ) ; - bridge.putChar( o, key, v ) ; + if ((fld != null) && (fld.getType() == Character.TYPE)) { + long key = bridge.objectFieldOffset( fld ) ; + bridge.putChar( o, key, v ) ; + } else { + throw new InvalidObjectException("Field Type mismatch"); + } } catch (Exception e) { - throw utilWrapper.errorSetCharField( e, fieldName, - o.toString(), - new Character(v) ) ; + if (o != null) { + throw utilWrapper.errorSetCharField( e, fieldName, + o.toString(), + new Character(v) ) ; + } else { + throw utilWrapper.errorSetCharField( e, fieldName, + "null " + c.getName() + " object", + new Character(v) ) ; + } } } @@ -2613,12 +2648,22 @@ { try { Field fld = c.getDeclaredField( fieldName ) ; - long key = bridge.objectFieldOffset( fld ) ; - bridge.putShort( o, key, v ) ; + if ((fld != null) && (fld.getType() == Short.TYPE)) { + long key = bridge.objectFieldOffset( fld ) ; + bridge.putShort( o, key, v ) ; + } else { + throw new InvalidObjectException("Field Type mismatch"); + } } catch (Exception e) { + if (o != null) { throw utilWrapper.errorSetShortField( e, fieldName, o.toString(), new Short(v) ) ; + } else { + throw utilWrapper.errorSetShortField( e, fieldName, + "null " + c.getName() + " object", + new Short(v) ) ; + } } } @@ -2626,12 +2671,22 @@ { try { Field fld = c.getDeclaredField( fieldName ) ; - long key = bridge.objectFieldOffset( fld ) ; - bridge.putInt( o, key, v ) ; + if ((fld != null) && (fld.getType() == Integer.TYPE)) { + long key = bridge.objectFieldOffset( fld ) ; + bridge.putInt( o, key, v ) ; + } else { + throw new InvalidObjectException("Field Type mismatch"); + } } catch (Exception e) { - throw utilWrapper.errorSetIntField( e, fieldName, - o.toString(), - new Integer(v) ) ; + if (o != null) { + throw utilWrapper.errorSetIntField( e, fieldName, + o.toString(), + new Integer(v) ) ; + } else { + throw utilWrapper.errorSetIntField( e, fieldName, + "null " + c.getName() + " object", + new Integer(v) ) ; + } } } @@ -2639,12 +2694,22 @@ { try { Field fld = c.getDeclaredField( fieldName ) ; - long key = bridge.objectFieldOffset( fld ) ; - bridge.putLong( o, key, v ) ; + if ((fld != null) && (fld.getType() == Long.TYPE)) { + long key = bridge.objectFieldOffset( fld ) ; + bridge.putLong( o, key, v ) ; + } else { + throw new InvalidObjectException("Field Type mismatch"); + } } catch (Exception e) { - throw utilWrapper.errorSetLongField( e, fieldName, - o.toString(), - new Long(v) ) ; + if (o != null) { + throw utilWrapper.errorSetLongField( e, fieldName, + o.toString(), + new Long(v) ) ; + } else { + throw utilWrapper.errorSetLongField( e, fieldName, + "null " + c.getName() + " object", + new Long(v) ) ; + } } } @@ -2652,12 +2717,22 @@ { try { Field fld = c.getDeclaredField( fieldName ) ; - long key = bridge.objectFieldOffset( fld ) ; - bridge.putFloat( o, key, v ) ; + if ((fld != null) && (fld.getType() == Float.TYPE)) { + long key = bridge.objectFieldOffset( fld ) ; + bridge.putFloat( o, key, v ) ; + } else { + throw new InvalidObjectException("Field Type mismatch"); + } } catch (Exception e) { - throw utilWrapper.errorSetFloatField( e, fieldName, - o.toString(), - new Float(v) ) ; + if (o != null) { + throw utilWrapper.errorSetFloatField( e, fieldName, + o.toString(), + new Float(v) ) ; + } else { + throw utilWrapper.errorSetFloatField( e, fieldName, + "null " + c.getName() + " object", + new Float(v) ) ; + } } } @@ -2665,12 +2740,22 @@ { try { Field fld = c.getDeclaredField( fieldName ) ; - long key = bridge.objectFieldOffset( fld ) ; - bridge.putDouble( o, key, v ) ; + if ((fld != null) && (fld.getType() == Double.TYPE)) { + long key = bridge.objectFieldOffset( fld ) ; + bridge.putDouble( o, key, v ) ; + } else { + throw new InvalidObjectException("Field Type mismatch"); + } } catch (Exception e) { - throw utilWrapper.errorSetDoubleField( e, fieldName, - o.toString(), - new Double(v) ) ; + if (o != null) { + throw utilWrapper.errorSetDoubleField( e, fieldName, + o.toString(), + new Double(v) ) ; + } else { + throw utilWrapper.errorSetDoubleField( e, fieldName, + "null " + c.getName() + " object", + new Double(v) ) ; + } } }