525 |
} |
} |
526 |
|
|
527 |
// write class initializer method if present |
// write class initializer method if present |
528 |
if (hasClassInitializer (cl)) |
if (VMObjectStreamClass.hasClassInitializer (cl)) |
529 |
{ |
{ |
530 |
data_out.writeUTF ("<clinit>"); |
data_out.writeUTF ("<clinit>"); |
531 |
data_out.writeInt (Modifier.STATIC); |
data_out.writeInt (Modifier.STATIC); |
613 |
return o; |
return o; |
614 |
} |
} |
615 |
|
|
|
|
|
|
// Returns true if CLAZZ has a static class initializer |
|
|
// (a.k.a. <clinit>). |
|
|
private static boolean hasClassInitializer (Class clazz) |
|
|
{ |
|
|
Method m = null; |
|
|
|
|
|
try |
|
|
{ |
|
|
/* |
|
|
* There exists a problem here, according to the spec |
|
|
* clazz.getDeclaredMethod ("<clinit>", classArgs); |
|
|
* will always throw NoSuchMethodException, even if the static |
|
|
* intializer does exist. |
|
|
*/ |
|
|
Class classArgs[] = {}; |
|
|
m = clazz.getDeclaredMethod ("<clinit>", classArgs); |
|
|
} |
|
|
catch (java.lang.NoSuchMethodException e) |
|
|
{ |
|
|
} |
|
|
|
|
|
return m != null; |
|
|
} |
|
|
|
|
616 |
public static final ObjectStreamField[] NO_FIELDS = {}; |
public static final ObjectStreamField[] NO_FIELDS = {}; |
617 |
|
|
618 |
private static Hashtable classLookupTable = new Hashtable (); |
private static Hashtable classLookupTable = new Hashtable (); |