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 JavaObjectArray.resolve, there is code to attempt to handle the case where the class object for the class of the array cannot be found.
if (clazz == null) {
clazz = snapshot.getOtherArrayType();
}
However, this does not work because fiels clazz is never null - it contains a Number which is the id of the class object we are looking for. JHAT then crashes when it tries to cast the Number to a JavaClass.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
The followint change seems to work:
original:
public void resolve(Snapshot snapshot) {
long classID = getIdValue((Number)clazz);
if (snapshot.isNewStyleArrayClass()) {
replacement:
public void resolve(Snapshot snapshot) {
long classID = getIdValue((Number)clazz);
clazz=null; // add this line
if (snapshot.isNewStyleArrayClass()) {