OscarRodriguezPrieto / ProgQuery

ProgQuery is a system to extract useful syntactic and semantic information from source code programs and store it in a graph database for posterior querying.
MIT License
15 stars 4 forks source link

Some types are not found when invoking JavacInfo.getTypeMirror for type identifiers #38

Open OscarRodriguezPrieto opened 2 years ago

OscarRodriguezPrieto commented 2 years ago

For some projects and some specific classes (some second classes in comp units), JavacInfo.getTypeMirror invocations throw Caused by: java.lang.NullPointerException: Cannot invoke "com.sun.source.util.TreePath.getLeaf()" because "path" is null when trying to add the type of (an array, isntanceof, cast...) to the dependency graph by invoking addClassIdentifier(JavacInfo.getTypeMirror(x.getType())

The solution is applying instanceof and cast to directly retrieve the type of the type identifier.