Mon, 14 Nov 2011 18:16:31 -0800
Merge
1.1 --- a/src/share/classes/com/sun/corba/se/impl/io/IIOPInputStream.java Thu Nov 10 11:45:56 2011 -0800 1.2 +++ b/src/share/classes/com/sun/corba/se/impl/io/IIOPInputStream.java Mon Nov 14 18:16:31 2011 -0800 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -2243,6 +2243,10 @@ 1.11 } 1.12 1.13 try { 1.14 + Class fieldCl = fields[i].getClazz(); 1.15 + if (objectValue != null && !fieldCl.isInstance(objectValue)) { 1.16 + throw new IllegalArgumentException(); 1.17 + } 1.18 bridge.putObject( o, fields[i].getFieldID(), objectValue ) ; 1.19 // reflective code: fields[i].getField().set( o, objectValue ) ; 1.20 } catch (IllegalArgumentException e) { 1.21 @@ -2553,6 +2557,10 @@ 1.22 { 1.23 try { 1.24 Field fld = c.getDeclaredField( fieldName ) ; 1.25 + Class fieldCl = fld.getType(); 1.26 + if(v != null && !fieldCl.isInstance(v)) { 1.27 + throw new Exception(); 1.28 + } 1.29 long key = bridge.objectFieldOffset( fld ) ; 1.30 bridge.putObject( o, key, v ) ; 1.31 } catch (Exception e) {