paul-hammant / qdox

QDox - full extractor of Java class/interface/method definitions (including annotations, parameters, param names)
Other
461 stars 69 forks source link

Potential NPE in com.thoughtworks.qdox.library.SourceLibrary#addSource(java.io.File) #131

Open imndszy opened 2 years ago

imndszy commented 2 years ago

There is a potential NPE in https://github.com/paul-hammant/qdox/blob/20c12cb233f536aee4b5a3c744381afed5ff3943/src/main/java/com/thoughtworks/qdox/library/SourceLibrary.java#L174-L175 when parsing package-info.java returns null.

rfscholte commented 1 year ago

Well, that means that the code won't compile right?

imndszy commented 1 year ago

Well, that means that the code won't compile right?

In my case, package-info.java is empty so the whole project still compiles successfully.

rbrtjr commented 1 year ago

I also got an NPE with com.thoughtworks.qdox.model.JavaPackage.getName() while processing IMPORTS section:

Arquivo QDOX:E:\projects\parsed\(M6)-airavata-airavata-0.19.qdox
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "com.thoughtworks.qdox.model.JavaPackage.getName()" because the return value of "com.thoughtworks.qdox.model.JavaSource.getPackage()" is null
rbrtjr commented 1 year ago

Another NPE on "thoughtworks"...

Exception in thread "main" com.thoughtworks.qdox.parser.ParseException: syntax error @[28,44] in file:/E:/projects/software/apache-beam-2.44.0/beam-2.44.0/runners/core-java/src/main/java/org/apache/beam/runners/core/DoFnRunner.java