Skip to content

Commit d5a198d

Browse files
author
emmanue1
committed
Fixed NPE when decompiling java.lang.Object
1 parent c010755 commit d5a198d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/main/java/org/jd/core/v1/service/converter/classfiletojavasyntax/util/LocalVariableMaker.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ public LocalVariableMaker(ObjectTypeMaker objectTypeMaker, SignatureParser signa
7474
}
7575

7676
objectTypeMaker.make(classFile.getInternalTypeName()).accept(populateBlackListNamesVisitor);
77-
objectTypeMaker.make(classFile.getSuperTypeName()).accept(populateBlackListNamesVisitor);
77+
78+
if (classFile.getSuperTypeName() != null) {
79+
objectTypeMaker.make(classFile.getSuperTypeName()).accept(populateBlackListNamesVisitor);
80+
}
7881

7982
if (classFile.getInterfaceTypeNames() != null) {
8083
for (String interfaceTypeName : classFile.getInterfaceTypeNames()) {

src/main/java/org/jd/core/v1/service/deserializer/classfile/ClassFileDeserializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ protected ClassFile loadClassFile(ClassFileReader reader) throws UTFDataFormatEx
101101
int superClassIndex = reader.readUnsignedShort();
102102

103103
String internalTypeName = constants.getConstantTypeName(thisClassIndex);
104-
String superTypeName = constants.getConstantTypeName(superClassIndex);
104+
String superTypeName = "java/lang/Object".equals(internalTypeName) ? null : constants.getConstantTypeName(superClassIndex);
105105
String[] interfaceTypeNames = loadInterfaces(reader, constants);
106106
Field[] fields = loadFields(reader, constants);
107107
Method[] methods = loadMethods(reader, constants);

0 commit comments

Comments
 (0)