-
Bug
-
Resolution: Won't Fix
-
P4
-
6
-
generic
-
generic
Calling Field.type() which causes a JDWP ClassLoader.VisibleClasses
command to be sent, seems to cause a following VirtualMachine.allClasses()
call to return classes that are not prepared, as in the following example code:
private void foo(VirtualMachine vm)
{
String margin "[GUS: ";
System.err.println(margin+".................................................");
vm.setDebugTraceMode(VirtualMachine.TRACE_ALL);
try
{
for (Iterator it = vm.classesByName("gus.classloader.PolicyClassLoader").iterator(); it.hasNext(); )
{
ReferenceType rt = (ReferenceType)it.next();
System.err.println(margin+"before rt.fieldByName");
Field field = rt.fieldByName("parent");
System.err.println(margin+"after rt.fieldByName");
System.err.println(margin+"before field.type");
Type type = field.type(); // This causes JDWP.ClassLoaderReference.VisibleClasses
System.err.println(margin+"after field.type");
}
for (Iterator it = vm.allClasses().iterator(); it.hasNext(); )
{
ReferenceType rt = (ReferenceType)it.next();
if (! rt.isPrepared())
{
System.err.println(margin+"rt.name(): " + rt.name());
System.err.println(margin+"rt.isPrepared(): " + rt.isPrepared());
System.err.println(margin+"rt.isInitialized(): " + rt.isInitialized());
System.err.println(margin+"rt.isVerified(): " + rt.isVerified());
System.err.println(margin+"rt.failedToInitialize(): " + rt.failedToInitialize());
System.err.println(margin+"");
ObjectReference or = null;
try
{
or = rt.classObject();
System.err.println(margin+"rt.classObject(): " + or);
}
catch (Exception e)
{
System.err.println(margin+"rt.classObject() threw " + e);
}
try
{
if (or != null)
System.err.println(margin+"or.isCollected(): " + or.isCollected());
}
catch (Exception e)
{
System.err.println(margin+"or.isCollected() threw " + e);
}
}
}
}
catch (Exception e)
{
e.printStackTrace();
}
vm.setDebugTraceMode(VirtualMachine.TRACE_NONE);
}
command to be sent, seems to cause a following VirtualMachine.allClasses()
call to return classes that are not prepared, as in the following example code:
private void foo(VirtualMachine vm)
{
String margin "[GUS: ";
System.err.println(margin+".................................................");
vm.setDebugTraceMode(VirtualMachine.TRACE_ALL);
try
{
for (Iterator it = vm.classesByName("gus.classloader.PolicyClassLoader").iterator(); it.hasNext(); )
{
ReferenceType rt = (ReferenceType)it.next();
System.err.println(margin+"before rt.fieldByName");
Field field = rt.fieldByName("parent");
System.err.println(margin+"after rt.fieldByName");
System.err.println(margin+"before field.type");
Type type = field.type(); // This causes JDWP.ClassLoaderReference.VisibleClasses
System.err.println(margin+"after field.type");
}
for (Iterator it = vm.allClasses().iterator(); it.hasNext(); )
{
ReferenceType rt = (ReferenceType)it.next();
if (! rt.isPrepared())
{
System.err.println(margin+"rt.name(): " + rt.name());
System.err.println(margin+"rt.isPrepared(): " + rt.isPrepared());
System.err.println(margin+"rt.isInitialized(): " + rt.isInitialized());
System.err.println(margin+"rt.isVerified(): " + rt.isVerified());
System.err.println(margin+"rt.failedToInitialize(): " + rt.failedToInitialize());
System.err.println(margin+"");
ObjectReference or = null;
try
{
or = rt.classObject();
System.err.println(margin+"rt.classObject(): " + or);
}
catch (Exception e)
{
System.err.println(margin+"rt.classObject() threw " + e);
}
try
{
if (or != null)
System.err.println(margin+"or.isCollected(): " + or.isCollected());
}
catch (Exception e)
{
System.err.println(margin+"or.isCollected() threw " + e);
}
}
}
}
catch (Exception e)
{
e.printStackTrace();
}
vm.setDebugTraceMode(VirtualMachine.TRACE_NONE);
}
- relates to
-
JDK-6257820 JDWP/JDWP Spec: mismatch on handling of unprepared classes by 'AllClasses' command
-
- Closed
-