JDK-6476644 : JHAT - Missing java.lang.class mishandled
  • Type: Bug
  • Component: core-svc
  • Sub-Component: tools
  • Affected Version: 6
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2006-09-29
  • Updated: 2011-02-16
  • Resolved: 2007-02-13
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
jdk-6-rc-src-b100-jrl-27_sep_2006

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]

A DESCRIPTION OF THE PROBLEM :
In Snapshot.resolve,  there is code to attempt to handle the case where the JavaClass for "java.lang.Class" is not found. A stand-in object is created, but field javaLangClass is never assigned a value and is later dereferences (leading to NPE).


REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
This works better: (in Snapshot.java, public void resolve(boolean calculateRefs))
	if (javaLangClass == null) {
	    System.out.println("WARNING:  hprof file does not include java.lang.Class!");
            javaLangClass=new JavaClass("java.lang.Class", 0, 0, 0, 0,
                EMPTY_FIELD_ARRAY, EMPTY_STATIC_ARRAY, 0);
            addFakeClass(javaLangClass);
	}

Comments
EVALUATION This has been handled as part of fix for 6476946 (JHAT - Missing class mishandled). This bug is slightly different from 6476946 (current one is about missing java.lang.Class class - which is particular case of missing class). Since we fixed this as part of 6476946 fix, I'm closing this as "duplicate".
13-02-2007