IBM / codenet-minerva-code-analyzer

Java source code (and/or binary) to JSON based system dependency graph generator.
Apache License 2.0
1 stars 3 forks source link

NullPointer exception when running code analyzer in a project with upper case Java extension #24

Closed fabio-franco closed 3 months ago

fabio-franco commented 3 months ago

When I have a Java file extension in upper case, I get a null pointer exception when trying to run the code analyzer. Basically, I changed a file extension in a single Java file from .java to .JAVA and then I ran the code analyzer, which showed the following:

java -version
openjdk version "21.0.1" 2023-10-17 LTS
...
java -jar <mypath>/codeanalyzer.jar -i <mypath>/modresorts -o <mypath>/outputFolder -a 2
java.lang.NullPointerException: Cannot invoke "java.util.List.size()" because "applicationClassFiles" is null
    at com.ibm.northstar.utils.ScopeUtils.createScope(ScopeUtils.java:105)
    at com.ibm.northstar.SystemDependencyGraph.construct(SystemDependencyGraph.java:215)
    at com.ibm.northstar.CodeAnalyzer.analyze(CodeAnalyzer.java:122)
    at com.ibm.northstar.CodeAnalyzer.run(CodeAnalyzer.java:91)
    at picocli.CommandLine.executeUserObject(CommandLine.java:1767)
    at picocli.CommandLine.access$900(CommandLine.java:145)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2139)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2106)
    at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:1973)
    at picocli.CommandLine.execute(CommandLine.java:1902)
    at com.ibm.northstar.CodeAnalyzer.main(CodeAnalyzer.java:82)