832 |
return fieldsArray; |
return fieldsArray; |
833 |
} |
} |
834 |
|
|
835 |
|
/** |
836 |
|
* Returns a new instance of the Class this ObjectStreamClass corresponds |
837 |
|
* to. |
838 |
|
* Note that this should only be used for Externalizable classes. |
839 |
|
* |
840 |
|
* @return A new instance. |
841 |
|
*/ |
842 |
|
Externalizable newInstance() throws InvalidClassException |
843 |
|
{ |
844 |
|
synchronized(this) |
845 |
|
{ |
846 |
|
if (constructor == null) |
847 |
|
{ |
848 |
|
try |
849 |
|
{ |
850 |
|
final Constructor c = clazz.getConstructor(new Class[0]); |
851 |
|
|
852 |
|
AccessController.doPrivileged(new PrivilegedAction() |
853 |
|
{ |
854 |
|
public Object run() |
855 |
|
{ |
856 |
|
c.setAccessible(true); |
857 |
|
return null; |
858 |
|
} |
859 |
|
}); |
860 |
|
|
861 |
|
constructor = c; |
862 |
|
} |
863 |
|
catch(NoSuchMethodException x) |
864 |
|
{ |
865 |
|
throw new InvalidClassException(clazz.getName(), |
866 |
|
"No public zero-argument constructor"); |
867 |
|
} |
868 |
|
} |
869 |
|
} |
870 |
|
|
871 |
|
try |
872 |
|
{ |
873 |
|
return (Externalizable)constructor.newInstance(null); |
874 |
|
} |
875 |
|
catch(Throwable t) |
876 |
|
{ |
877 |
|
throw (InvalidClassException) |
878 |
|
new InvalidClassException(clazz.getName(), |
879 |
|
"Unable to instantiate").initCause(t); |
880 |
|
} |
881 |
|
} |
882 |
|
|
883 |
public static final ObjectStreamField[] NO_FIELDS = {}; |
public static final ObjectStreamField[] NO_FIELDS = {}; |
884 |
|
|
885 |
private static Hashtable classLookupTable = new Hashtable(); |
private static Hashtable classLookupTable = new Hashtable(); |
909 |
boolean realClassIsExternalizable; |
boolean realClassIsExternalizable; |
910 |
ObjectStreamField[] fieldMapping; |
ObjectStreamField[] fieldMapping; |
911 |
Class firstNonSerializableParent; |
Class firstNonSerializableParent; |
912 |
|
private Constructor constructor; // default constructor for Externalizable |
913 |
|
|
914 |
boolean isProxyClass = false; |
boolean isProxyClass = false; |
915 |
|
|