Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ public Path analyze(Path sourceDirectory, Path outputDirectory, String outputFil
} else {
throw e;
}
} catch (IndexOutOfBoundsException | ClassFormatError | NegativeArraySizeException e) {
//IDETECT-4924 Handle malformed classes properly
brokenFiles.put(classFile, "Malformed class structure: " + Strings.nullToEmpty(e.getMessage()));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,12 @@ private Type getReturnType(String descriptor) {

try {
return Type.getType(descriptor);
} catch (StringIndexOutOfBoundsException e2) {
} catch (StringIndexOutOfBoundsException | IllegalArgumentException e2) {
// IDETECT-3909 This can occur for malformed signatures which are just the type, not the method, for
// an unknown reason
logger.warn("Malformed method descriptor, skipping reference processing: {}:{} ({})", currentClassName, currentMethodName, descriptor);

return Type.getType(descriptor);
return Type.getType(Object.class);
}
}
}
Expand Down