} else if (className.equals(javaLangClassLoader)) {
object = new ClassLoaderReferenceImpl(this, inst);
} else {
// not a well-known class. But the base class may be
// one of the known classes.
Klass kls = key.getKlass().getSuper();
while (kls != null) {
className = kls.getName();
// java.lang.Class and java.lang.String are final classes
if (className.equals(javaLangThread)) {
object = new ThreadReferenceImpl(this, inst);
break;
} else if(className.equals(javaLangThreadGroup)) {
object = new ThreadGroupReferenceImpl(this, inst);
break;
} else if (className.equals(javaLangClassLoader)) {
object = new ClassLoaderReferenceImpl(this, inst);
break;
}
kls = kls.getSuper();
}
if (object == null) {
// create generic object reference
object = new ObjectReferenceImpl(this, inst);