-
Bug
-
Resolution: Won't Fix
-
P4
-
None
-
1.3.0, 1.4.2
-
None
-
x86, sparc
-
solaris_2.5, solaris_2.6, windows_nt
When the serialver tool loads a class (specified on the command line)
in order to calculate the serialVersionUID for that class, it specifies
that the class should be initialized:
/*
* From the classname find the serialVersionUID string formatted
* for to be copied to a java class.
*/
static String serialSyntax(String classname) throws ClassNotFoundException {
Class cl = Class.forName(classname, true, loader);
ObjectStreamClass desc = ObjectStreamClass.lookup(cl);
if (desc != null) {
return " static final long serialVersionUID = " +
desc.getSerialVersionUID() + "L;";
} else {
return null;
}
}
The second parameter to the Class.forName method is "true" which
causes the class to be initialized resulting in the static initializers
for the class being run. To calculate the serialVersionUID for a
class, it is not necessary for the class to be initialized and in
some cases, errors will occur because the static initializers attempt
to load a library, for example.
in order to calculate the serialVersionUID for that class, it specifies
that the class should be initialized:
/*
* From the classname find the serialVersionUID string formatted
* for to be copied to a java class.
*/
static String serialSyntax(String classname) throws ClassNotFoundException {
Class cl = Class.forName(classname, true, loader);
ObjectStreamClass desc = ObjectStreamClass.lookup(cl);
if (desc != null) {
return " static final long serialVersionUID = " +
desc.getSerialVersionUID() + "L;";
} else {
return null;
}
}
The second parameter to the Class.forName method is "true" which
causes the class to be initialized resulting in the static initializers
for the class being run. To calculate the serialVersionUID for a
class, it is not necessary for the class to be initialized and in
some cases, errors will occur because the static initializers attempt
to load a library, for example.
- duplicates
-
JDK-4330116 serialver hangs while processing java.awt.dnd.DropTarget
-
- Closed
-
-
JDK-4330861 serialver hangs while processing java.awt.SystemColor
-
- Closed
-