Mercurial > hg > release > icedtea7-forest-2.6 > corba
changeset 956:d99431d571f8 icedtea-2.6pre04
Merge jdk7u60-b15
author | andrew |
---|---|
date | Fri, 02 May 2014 20:39:22 +0100 |
parents | 9a1106043985 (current diff) e5946b2cf82b (diff) |
children | 90a4103857ca |
files | .hgtags |
diffstat | 5 files changed, 127 insertions(+), 143 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgtags Wed Apr 30 22:01:11 2014 +0100 +++ b/.hgtags Fri May 02 20:39:22 2014 +0100 @@ -396,6 +396,7 @@ c5b5886004e6446b8b27ccdc1fd073354c1dc614 jdk7u60-b00 d641ac83157ec86219519c0cbaf3122bdc997136 jdk7u45-b33 aa24e046a2da95637257c9effeaabe254db0aa0b jdk7u45-b34 +fab1423e6ab8ecf36da8b6bf2e454156ec701e8a jdk7u45-b35 b1f069eb48edfa6fb7428dc045a53e287215ef4a jdk7u51-b00 8d884cf2e8cce92d532950de2c7283d9804f9e58 jdk7u51-b01 327035fbb0433927c1b1af2bc0bcb84e7827f1b9 jdk7u51-b02 @@ -412,6 +413,26 @@ e2f0036f712aa636cfd55334ac21ea7ca2587a7b jdk7u51-b13 6563d12c48c92af39a27ca46b4515fad8e994667 jdk7u51-b30 0ad990211737fe1b1e2737a3498ab266146d2c53 jdk7u51-b31 +ee7d9f5d18fb67564e88a10f1bd682660db60aa2 jdk7u51-b33 +65ef96a075a43e9201866d1c9b8ee3138ebcc424 jdk7u51-b34 +55a509ccc0e4ed49e311c7ecf2ed29a908bc1d6b jdk7u55-b00 +aabfdc799c0799837dcbbf9ea8d6df1511978b1f jdk7u55-b01 +db2e6d87bade9d2061646ff9a6b39b5159fba0ec jdk7u55-b02 +02ff18f156bd3382fe22e4758b138370f5238e97 jdk7u55-b03 +6a88a170331fb38af5046e54bf75f38176af5c41 jdk7u55-b04 +a8d27c3fc4e4e6cd99fa164f04c30a71f474a2d6 jdk7u55-b05 +af7f1808106bf4e9b4680d943677299829245d08 jdk7u55-b06 +44801796d42bebc90e8c4c7fb5bd79db04b10b75 jdk7u55-b07 +aa98fb8dc3608a30ac593635b21aca2105aaab20 jdk7u55-b08 +2a4842e7ca0b2228017542cea0fed3b8d4f4491a jdk7u55-b09 +5805c3291eb3a82cd75e95ac06eb13daa7f92866 jdk7u55-b09 +b9dae31c56a2bf69fc5932cc490cd80fccc1e0fd jdk7u55-b10 +cbd5b4b07e0c8a5f61eff396b7622e7b04d2a164 jdk7u55-b11 +3cce2a49d18d93dfca2634db32368486ebbb1590 jdk7u55-b12 +8efa6e66c13a5329c312d1a521ffab75d9a330e3 jdk7u55-b13 +e041c52fe69128ec3439d26afef9b0fcba00684c jdk7u55-b30 +a0bfd0e80ae0ae6e3a29bf527b5911c83163b3f5 jdk7u55-b14 +55ff6957449cf6c79f5d5bb159df27f51ece1659 jdk7u55-b31 c5b5886004e6446b8b27ccdc1fd073354c1dc614 jdk7u60-b00 a531112cc6d0b0a1e7d4ffdaa3ba53addcd25cf4 jdk7u60-b01 d81370c5b863acc19e8fb07315b1ec687ac1136a jdk7u60-b02 @@ -431,3 +452,4 @@ 2c8ba5f9487b0ac085874afd38f4c10a4127f62c jdk7u60-b13 8293bea019e34e9cea722b46ba578fd4631f685f icedtea-2.6pre02 35fa09c49527a46a29e210f174584cc1d806dbf8 icedtea-2.6pre03 +02bdeb33754315f589bd650dde656d2c9947976d jdk7u60-b14
--- a/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java Wed Apr 30 22:01:11 2014 +0100 +++ b/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java Fri May 02 20:39:22 2014 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,6 +52,7 @@ import java.io.DataOutputStream; import java.io.ByteArrayOutputStream; import java.io.InvalidClassException; +import java.io.Externalizable; import java.io.Serializable; import java.util.Arrays; @@ -82,15 +83,15 @@ public static final long kDefaultUID = -1; private static Object noArgsList[] = {}; - private static Class noTypesList[] = {}; + private static Class<?> noTypesList[] = {}; /** true if represents enum type */ private boolean isEnum; private static final Bridge bridge = - (Bridge)AccessController.doPrivileged( - new PrivilegedAction() { - public Object run() { + AccessController.doPrivileged( + new PrivilegedAction<Bridge>() { + public Bridge run() { return Bridge.get() ; } } @@ -100,7 +101,7 @@ * is returned if the specified class does not implement * java.io.Serializable or java.io.Externalizable. */ - static final ObjectStreamClass lookup(Class cl) + static final ObjectStreamClass lookup(Class<?> cl) { ObjectStreamClass desc = lookupInternal(cl); if (desc.isSerializable() || desc.isExternalizable()) @@ -112,7 +113,7 @@ * Find the class descriptor for the specified class. * Package access only so it can be called from ObjectIn/OutStream. */ - static ObjectStreamClass lookupInternal(Class cl) + static ObjectStreamClass lookupInternal(Class<?> cl) { /* Synchronize on the hashtable so no two threads will do * this at the same time. @@ -123,14 +124,14 @@ desc = findDescriptorFor(cl); if (desc == null) { /* Check if it's serializable */ - boolean serializable = classSerializable.isAssignableFrom(cl); + boolean serializable = Serializable.class.isAssignableFrom(cl); /* If the class is only Serializable, * lookup the descriptor for the superclass. */ ObjectStreamClass superdesc = null; if (serializable) { - Class superclass = cl.getSuperclass(); + Class<?> superclass = cl.getSuperclass(); if (superclass != null) superdesc = lookup(superclass); } @@ -143,7 +144,7 @@ if (serializable) { externalizable = ((superdesc != null) && superdesc.isExternalizable()) || - classExternalizable.isAssignableFrom(cl); + Externalizable.class.isAssignableFrom(cl); if (externalizable) { serializable = false; } @@ -187,7 +188,7 @@ * that have evolved from a common root class and agree to be serialized * and deserialized using a common format. */ - public static final long getSerialVersionUID( java.lang.Class clazz) { + public static final long getSerialVersionUID( java.lang.Class<?> clazz) { ObjectStreamClass theosc = ObjectStreamClass.lookup( clazz ); if( theosc != null ) { @@ -221,7 +222,7 @@ /** * Return the actual (computed) serialVersionUID for this class. */ - public static final long getActualSerialVersionUID( java.lang.Class clazz ) + public static final long getActualSerialVersionUID( java.lang.Class<?> clazz ) { ObjectStreamClass theosc = ObjectStreamClass.lookup( clazz ); if( theosc != null ) @@ -251,7 +252,7 @@ * Return the class in the local VM that this version is mapped to. * Null is returned if there is no corresponding local class. */ - public final Class forClass() { + public final Class<?> forClass() { return ofClass; } @@ -351,7 +352,7 @@ * Create a new ObjectStreamClass from a loaded class. * Don't call this directly, call lookup instead. */ - private ObjectStreamClass(java.lang.Class cl, ObjectStreamClass superdesc, + private ObjectStreamClass(java.lang.Class<?> cl, ObjectStreamClass superdesc, boolean serial, boolean extern) { ofClass = cl; /* created from this class */ @@ -390,7 +391,7 @@ PersistentFieldsValue() { } - ObjectStreamField[] get(Class type) { + ObjectStreamField[] get(Class<?> type) { Object value = map.get(type); if (value == null) { value = computeValue(type); @@ -448,7 +449,7 @@ if (initialized) return; - final Class cl = ofClass; + final Class<?> cl = ofClass; if (!serializable || externalizable || @@ -576,9 +577,9 @@ * will call it as necessary. */ writeObjectMethod = getPrivateMethod( cl, "writeObject", - new Class[] { java.io.ObjectOutputStream.class }, Void.TYPE ) ; + new Class<?>[] { java.io.ObjectOutputStream.class }, Void.TYPE ) ; readObjectMethod = getPrivateMethod( cl, "readObject", - new Class[] { java.io.ObjectInputStream.class }, Void.TYPE ) ; + new Class<?>[] { java.io.ObjectInputStream.class }, Void.TYPE ) ; } return null; } @@ -604,9 +605,9 @@ * class, or null if none found. Access checks are disabled on the * returned method (if any). */ - private static Method getPrivateMethod(Class cl, String name, - Class[] argTypes, - Class returnType) + private static Method getPrivateMethod(Class<?> cl, String name, + Class<?>[] argTypes, + Class<?> returnType) { try { Method meth = cl.getDeclaredMethod(name, argTypes); @@ -667,7 +668,7 @@ * Fill in the reflected Fields that will be used * for reading. */ - final void setClass(Class cl) throws InvalidClassException { + final void setClass(Class<?> cl) throws InvalidClassException { if (cl == null) { localClassDesc = null; @@ -934,9 +935,9 @@ * Access checks are disabled on the returned constructor (if any), since * the defining class may still be non-public. */ - private static Constructor getExternalizableConstructor(Class cl) { + private static Constructor getExternalizableConstructor(Class<?> cl) { try { - Constructor cons = cl.getDeclaredConstructor(new Class[0]); + Constructor cons = cl.getDeclaredConstructor(new Class<?>[0]); cons.setAccessible(true); return ((cons.getModifiers() & Modifier.PUBLIC) != 0) ? cons : null; @@ -950,15 +951,15 @@ * superclass, or null if none found. Access checks are disabled on the * returned constructor (if any). */ - private static Constructor getSerializableConstructor(Class cl) { - Class initCl = cl; + private static Constructor getSerializableConstructor(Class<?> cl) { + Class<?> initCl = cl; while (Serializable.class.isAssignableFrom(initCl)) { if ((initCl = initCl.getSuperclass()) == null) { return null; } } try { - Constructor cons = initCl.getDeclaredConstructor(new Class[0]); + Constructor cons = initCl.getDeclaredConstructor(new Class<?>[0]); int mods = cons.getModifiers(); if ((mods & Modifier.PRIVATE) != 0 || ((mods & (Modifier.PUBLIC | Modifier.PROTECTED)) == 0 && @@ -1063,7 +1064,7 @@ * items to the hash accumulating in the digest stream. * Fold the hash into a long. Use the SHA secure hash function. */ - private static long _computeSerialVersionUID(Class cl) { + private static long _computeSerialVersionUID(Class<?> cl) { if (DEBUG_SVUID) msg( "Computing SerialVersionUID for " + cl ) ; ByteArrayOutputStream devnull = new ByteArrayOutputStream(512); @@ -1117,7 +1118,7 @@ * them from its computation. */ - Class interfaces[] = cl.getInterfaces(); + Class<?> interfaces[] = cl.getInterfaces(); Arrays.sort(interfaces, compareClassByName); for (int i = 0; i < interfaces.length; i++) { @@ -1247,7 +1248,7 @@ return h; } - private static long computeStructuralUID(com.sun.corba.se.impl.io.ObjectStreamClass osc, Class cl) { + private static long computeStructuralUID(com.sun.corba.se.impl.io.ObjectStreamClass osc, Class<?> cl) { ByteArrayOutputStream devnull = new ByteArrayOutputStream(512); long h = 0; @@ -1267,7 +1268,7 @@ DataOutputStream data = new DataOutputStream(mdo); // Get SUID of parent - Class parent = cl.getSuperclass(); + Class<?> parent = cl.getSuperclass(); if ((parent != null)) // SerialBug 1; acc. to spec the one for // java.lang.object @@ -1323,10 +1324,10 @@ /** * Compute the JVM signature for the class. */ - static String getSignature(Class clazz) { + static String getSignature(Class<?> clazz) { String type = null; if (clazz.isArray()) { - Class cl = clazz; + Class<?> cl = clazz; int dimensions = 0; while (cl.isArray()) { dimensions++; @@ -1372,7 +1373,7 @@ sb.append("("); - Class[] params = meth.getParameterTypes(); // avoid clone + Class<?>[] params = meth.getParameterTypes(); // avoid clone for (int j = 0; j < params.length; j++) { sb.append(getSignature(params[j])); } @@ -1389,7 +1390,7 @@ sb.append("("); - Class[] params = cons.getParameterTypes(); // avoid clone + Class<?>[] params = cons.getParameterTypes(); // avoid clone for (int j = 0; j < params.length; j++) { sb.append(getSignature(params[j])); } @@ -1409,7 +1410,7 @@ * The entries are extended from java.lang.ref.SoftReference so the * gc will be able to free them if needed. */ - private static ObjectStreamClass findDescriptorFor(Class cl) { + private static ObjectStreamClass findDescriptorFor(Class<?> cl) { int hash = cl.hashCode(); int index = (hash & 0x7FFFFFFF) % descriptorFor.length; @@ -1456,7 +1457,7 @@ descriptorFor[index] = e; } - private static Field[] getDeclaredFields(final Class clz) { + private static Field[] getDeclaredFields(final Class<?> clz) { return (Field[]) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { return clz.getDeclaredFields(); @@ -1490,7 +1491,7 @@ /* * Class that is a descriptor for in this virtual machine. */ - private Class ofClass; + private Class<?> ofClass; /* * True if descriptor for a proxy class. @@ -1562,30 +1563,17 @@ * Returns true if the given class defines a static initializer method, * false otherwise. */ - private static boolean hasStaticInitializer(Class cl) { + private static boolean hasStaticInitializer(Class<?> cl) { if (hasStaticInitializerMethod == null) { - Class classWithThisMethod = null; + Class<?> classWithThisMethod = null; try { - try { - // When using rip-int with Merlin or when this is a Merlin - // workspace, the method we want is in sun.misc.ClassReflector - // and absent from java.io.ObjectStreamClass. - // - // When compiling rip-int with JDK 1.3.x, we have to get it - // from java.io.ObjectStreamClass. - classWithThisMethod = Class.forName("sun.misc.ClassReflector"); - } catch (ClassNotFoundException cnfe) { - // Do nothing. This is either not a Merlin workspace, - // or rip-int is being compiled with something other than - // Merlin, probably JDK 1.3. Fall back on java.io.ObjectStreaClass. - } if (classWithThisMethod == null) classWithThisMethod = java.io.ObjectStreamClass.class; hasStaticInitializerMethod = classWithThisMethod.getDeclaredMethod("hasStaticInitializer", - new Class[] { Class.class }); + new Class<?>[] { Class.class }); } catch (NoSuchMethodException ex) { } @@ -1610,22 +1598,6 @@ } - /* The Class Object for java.io.Serializable */ - private static Class classSerializable = null; - private static Class classExternalizable = null; - - /* - * Resolve java.io.Serializable at load time. - */ - static { - try { - classSerializable = Class.forName("java.io.Serializable"); - classExternalizable = Class.forName("java.io.Externalizable"); - } catch (Throwable e) { - System.err.println("Could not load java.io.Serializable or java.io.Externalizable."); - } - } - /** use serialVersionUID from JDK 1.1. for interoperability */ private static final long serialVersionUID = -6120832682080437368L; @@ -1663,8 +1635,8 @@ private static class CompareClassByName implements Comparator { public int compare(Object o1, Object o2) { - Class c1 = (Class)o1; - Class c2 = (Class)o2; + Class<?> c1 = (Class)o1; + Class<?> c2 = (Class)o2; return (c1.getName()).compareTo(c2.getName()); } } @@ -1778,12 +1750,12 @@ * * Copied from the Merlin java.io.ObjectStreamClass. */ - private static Method getInheritableMethod(Class cl, String name, - Class[] argTypes, - Class returnType) + private static Method getInheritableMethod(Class<?> cl, String name, + Class<?>[] argTypes, + Class<?> returnType) { Method meth = null; - Class defCl = cl; + Class<?> defCl = cl; while (defCl != null) { try { meth = defCl.getDeclaredMethod(name, argTypes); @@ -1815,7 +1787,7 @@ * * Copied from the Merlin java.io.ObjectStreamClass. */ - private static boolean packageEquals(Class cl1, Class cl2) { + private static boolean packageEquals(Class<?> cl1, Class<?> cl2) { Package pkg1 = cl1.getPackage(), pkg2 = cl2.getPackage(); return ((pkg1 == pkg2) || ((pkg1 != null) && (pkg1.equals(pkg2)))); }
--- a/src/share/classes/com/sun/corba/se/impl/orbutil/ObjectStreamClassUtil_1_3.java Wed Apr 30 22:01:11 2014 +0100 +++ b/src/share/classes/com/sun/corba/se/impl/orbutil/ObjectStreamClassUtil_1_3.java Fri May 02 20:39:22 2014 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -94,7 +94,7 @@ }); } - public static long computeStructuralUID(boolean hasWriteObject, Class cl) { + public static long computeStructuralUID(boolean hasWriteObject, Class<?> cl) { ByteArrayOutputStream devnull = new ByteArrayOutputStream(512); long h = 0; @@ -119,7 +119,7 @@ // Object method in there // Get SUID of parent - Class parent = cl.getSuperclass(); + Class<?> parent = cl.getSuperclass(); if ((parent != null) && (parent != java.lang.Object.class)) { boolean hasWriteObjectFlag = false; Class [] args = {java.io.ObjectOutputStream.class}; @@ -503,19 +503,6 @@ Class classWithThisMethod = null; try { - try { - // When using rip-int with Merlin or when this is a Merlin - // workspace, the method we want is in sun.misc.ClassReflector - // and absent from java.io.ObjectStreamClass. - // - // When compiling rip-int with JDK 1.3.x, we have to get it - // from java.io.ObjectStreamClass. - classWithThisMethod = Class.forName("sun.misc.ClassReflector"); - } catch (ClassNotFoundException cnfe) { - // Do nothing. This is either not a Merlin workspace, - // or rip-int is being compiled with something other than - // Merlin, probably JDK 1.3. Fall back on java.io.ObjectStreaClass. - } if (classWithThisMethod == null) classWithThisMethod = java.io.ObjectStreamClass.class;
--- a/src/share/classes/com/sun/corba/se/impl/orbutil/ObjectStreamClass_1_3_1.java Wed Apr 30 22:01:11 2014 +0100 +++ b/src/share/classes/com/sun/corba/se/impl/orbutil/ObjectStreamClass_1_3_1.java Fri May 02 20:39:22 2014 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -53,6 +53,7 @@ import java.io.ByteArrayOutputStream; import java.io.InvalidClassException; import java.io.Serializable; +import java.io.Externalizable; import java.util.Arrays; import java.util.Comparator; @@ -88,7 +89,7 @@ public static final long kDefaultUID = -1; private static Object noArgsList[] = {}; - private static Class noTypesList[] = {}; + private static Class<?> noTypesList[] = {}; private static Hashtable translatedFields; @@ -96,7 +97,7 @@ * is returned if the specified class does not implement * java.io.Serializable or java.io.Externalizable. */ - static final ObjectStreamClass_1_3_1 lookup(Class cl) + static final ObjectStreamClass_1_3_1 lookup(Class<?> cl) { ObjectStreamClass_1_3_1 desc = lookupInternal(cl); if (desc.isSerializable() || desc.isExternalizable()) @@ -108,7 +109,7 @@ * Find the class descriptor for the specified class. * Package access only so it can be called from ObjectIn/OutStream. */ - static ObjectStreamClass_1_3_1 lookupInternal(Class cl) + static ObjectStreamClass_1_3_1 lookupInternal(Class<?> cl) { /* Synchronize on the hashtable so no two threads will do * this at the same time. @@ -122,13 +123,13 @@ } /* Check if it's serializable */ - boolean serializable = classSerializable.isAssignableFrom(cl); + boolean serializable = Serializable.class.isAssignableFrom(cl); /* If the class is only Serializable, * lookup the descriptor for the superclass. */ ObjectStreamClass_1_3_1 superdesc = null; if (serializable) { - Class superclass = cl.getSuperclass(); + Class<?> superclass = cl.getSuperclass(); if (superclass != null) superdesc = lookup(superclass); } @@ -141,7 +142,7 @@ if (serializable) { externalizable = ((superdesc != null) && superdesc.isExternalizable()) || - classExternalizable.isAssignableFrom(cl); + Externalizable.class.isAssignableFrom(cl); if (externalizable) { serializable = false; } @@ -170,7 +171,7 @@ * that have evolved from a common root class and agree to be serialized * and deserialized using a common format. */ - public static final long getSerialVersionUID( java.lang.Class clazz) { + public static final long getSerialVersionUID( java.lang.Class<?> clazz) { ObjectStreamClass_1_3_1 theosc = ObjectStreamClass_1_3_1.lookup( clazz ); if( theosc != null ) { @@ -204,7 +205,7 @@ /** * Return the actual (computed) serialVersionUID for this class. */ - public static final long getActualSerialVersionUID( java.lang.Class clazz ) + public static final long getActualSerialVersionUID( java.lang.Class<?> clazz ) { ObjectStreamClass_1_3_1 theosc = ObjectStreamClass_1_3_1.lookup( clazz ); if( theosc != null ) @@ -234,7 +235,7 @@ * Return the class in the local VM that this version is mapped to. * Null is returned if there is no corresponding local class. */ - public final Class forClass() { + public final Class<?> forClass() { return ofClass; } @@ -333,7 +334,7 @@ * Create a new ObjectStreamClass_1_3_1 from a loaded class. * Don't call this directly, call lookup instead. */ - private ObjectStreamClass_1_3_1(java.lang.Class cl, ObjectStreamClass_1_3_1 superdesc, + private ObjectStreamClass_1_3_1(java.lang.Class<?> cl, ObjectStreamClass_1_3_1 superdesc, boolean serial, boolean extern) { ofClass = cl; /* created from this class */ @@ -376,7 +377,7 @@ private void init() { synchronized (lock) { - final Class cl = ofClass; + final Class<?> cl = ofClass; if (fields != null) // already initialized return; @@ -558,7 +559,7 @@ * will call it as necessary. */ try { - Class[] args = {java.io.ObjectOutputStream.class}; + Class<?>[] args = {java.io.ObjectOutputStream.class}; writeObjectMethod = cl.getDeclaredMethod("writeObject", args); hasWriteObjectMethod = true; int mods = writeObjectMethod.getModifiers(); @@ -578,7 +579,7 @@ * ObjectInputStream so it can all the method directly. */ try { - Class[] args = {java.io.ObjectInputStream.class}; + Class<?>[] args = {java.io.ObjectInputStream.class}; readObjectMethod = cl.getDeclaredMethod("readObject", args); int mods = readObjectMethod.getModifiers(); @@ -629,11 +630,11 @@ if (translation != null) return translation; else { - Class osfClass = com.sun.corba.se.impl.orbutil.ObjectStreamField.class; + Class<?> osfClass = com.sun.corba.se.impl.orbutil.ObjectStreamField.class; translation = (Object[])java.lang.reflect.Array.newInstance(osfClass, objs.length); Object arg[] = new Object[2]; - Class types[] = {String.class, Class.class}; + Class<?> types[] = {String.class, Class.class}; Constructor constructor = osfClass.getDeclaredConstructor(types); for (int i = fields.length -1; i >= 0; i--){ arg[0] = fields[i].getName(); @@ -804,7 +805,7 @@ } } - private static long computeStructuralUID(ObjectStreamClass_1_3_1 osc, Class cl) { + private static long computeStructuralUID(ObjectStreamClass_1_3_1 osc, Class<?> cl) { ByteArrayOutputStream devnull = new ByteArrayOutputStream(512); long h = 0; @@ -824,7 +825,7 @@ DataOutputStream data = new DataOutputStream(mdo); // Get SUID of parent - Class parent = cl.getSuperclass(); + Class<?> parent = cl.getSuperclass(); if ((parent != null)) // SerialBug 1; acc. to spec the one for // java.lang.object @@ -910,10 +911,10 @@ /** * Compute the JVM signature for the class. */ - static String getSignature(Class clazz) { + static String getSignature(Class<?> clazz) { String type = null; if (clazz.isArray()) { - Class cl = clazz; + Class<?> cl = clazz; int dimensions = 0; while (cl.isArray()) { dimensions++; @@ -959,7 +960,7 @@ sb.append("("); - Class[] params = meth.getParameterTypes(); // avoid clone + Class<?>[] params = meth.getParameterTypes(); // avoid clone for (int j = 0; j < params.length; j++) { sb.append(getSignature(params[j])); } @@ -976,7 +977,7 @@ sb.append("("); - Class[] params = cons.getParameterTypes(); // avoid clone + Class<?>[] params = cons.getParameterTypes(); // avoid clone for (int j = 0; j < params.length; j++) { sb.append(getSignature(params[j])); } @@ -996,7 +997,7 @@ * The entries are extended from java.lang.ref.SoftReference so the * gc will be able to free them if needed. */ - private static ObjectStreamClass_1_3_1 findDescriptorFor(Class cl) { + private static ObjectStreamClass_1_3_1 findDescriptorFor(Class<?> cl) { int hash = cl.hashCode(); int index = (hash & 0x7FFFFFFF) % descriptorFor.length; @@ -1077,7 +1078,7 @@ /* * Class that is a descriptor for in this virtual machine. */ - private Class ofClass; + private Class<?> ofClass; /* * True if descriptor for a proxy class. @@ -1130,22 +1131,6 @@ /* Get the private static final field for serial version UID */ // private static native long getSerialVersionUIDField(Class cl); - /* The Class Object for java.io.Serializable */ - private static Class classSerializable = null; - private static Class classExternalizable = null; - - /* - * Resolve java.io.Serializable at load time. - */ - static { - try { - classSerializable = Class.forName("java.io.Serializable"); - classExternalizable = Class.forName("java.io.Externalizable"); - } catch (Throwable e) { - System.err.println("Could not load java.io.Serializable or java.io.Externalizable."); - } - } - /** use serialVersionUID from JDK 1.1. for interoperability */ private static final long serialVersionUID = -6120832682080437368L; @@ -1183,8 +1168,8 @@ private static class CompareClassByName implements Comparator { public int compare(Object o1, Object o2) { - Class c1 = (Class)o1; - Class c2 = (Class)o2; + Class<?> c1 = (Class)o1; + Class<?> c2 = (Class)o2; return (c1.getName()).compareTo(c2.getName()); } }
--- a/src/share/classes/org/omg/CORBA/ORB.java Wed Apr 30 22:01:11 2014 +0100 +++ b/src/share/classes/org/omg/CORBA/ORB.java Fri May 02 20:39:22 2014 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,6 +36,8 @@ import java.security.AccessController; import java.security.PrivilegedAction; +import sun.reflect.misc.ReflectUtil; + /** * A class providing APIs for the CORBA Object Request Broker * features. The <code>ORB</code> class also provides @@ -289,20 +291,38 @@ (className.equals("com.sun.corba.se.impl.orb.ORBSingleton"))) { singleton = new com.sun.corba.se.impl.orb.ORBSingleton(); } else { - singleton = create_impl(className); + singleton = create_impl_with_systemclassloader(className); } } return singleton; } + private static ORB create_impl_with_systemclassloader(String className) { + + try { + ReflectUtil.checkPackageAccess(className); + ClassLoader cl = ClassLoader.getSystemClassLoader(); + Class<org.omg.CORBA.ORB> orbBaseClass = org.omg.CORBA.ORB.class; + Class<?> singletonOrbClass = Class.forName(className, true, cl).asSubclass(orbBaseClass); + return (ORB)singletonOrbClass.newInstance(); + } catch (Throwable ex) { + SystemException systemException = new INITIALIZE( + "can't instantiate default ORB implementation " + className); + systemException.initCause(ex); + throw systemException; + } + } + private static ORB create_impl(String className) { - ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (cl == null) cl = ClassLoader.getSystemClassLoader(); try { - return (ORB) Class.forName(className, true, cl).newInstance(); + ReflectUtil.checkPackageAccess(className); + Class<org.omg.CORBA.ORB> orbBaseClass = org.omg.CORBA.ORB.class; + Class<?> orbClass = Class.forName(className, true, cl).asSubclass(orbBaseClass); + return (ORB)orbClass.newInstance(); } catch (Throwable ex) { SystemException systemException = new INITIALIZE( "can't instantiate default ORB implementation " + className); @@ -346,7 +366,6 @@ } else { orb = create_impl(className); } - orb.set_parameters(args, props); return orb; } @@ -377,7 +396,6 @@ } else { orb = create_impl(className); } - orb.set_parameters(app, props); return orb; } @@ -573,7 +591,7 @@ try { // First try to load the OperationDef class String opDefClassName = "org.omg.CORBA.OperationDef"; - Class opDefClass = null; + Class<?> opDefClass = null; ClassLoader cl = Thread.currentThread().getContextClassLoader(); if ( cl == null ) @@ -583,7 +601,7 @@ // OK, we loaded OperationDef. Now try to get the // create_operation_list(OperationDef oper) method. - Class[] argc = { opDefClass }; + Class<?>[] argc = { opDefClass }; java.lang.reflect.Method meth = this.getClass().getMethod("create_operation_list", argc);