eclipse-vertx / vertx-codegen

Vert.x code generator for asynchronous polyglot APIs
Apache License 2.0
105 stars 92 forks source link

Work around compiler bug with JPMS #306

Closed vietj closed 4 years ago

vietj commented 4 years ago

When compiling a project with a module, the Elements.getPackageOf(Element) can throw an NPE like

Caused by: java.lang.NullPointerException
    at com.sun.tools.javac.code.Symbol.packge (Symbol.java:497)
    at com.sun.tools.javac.model.JavacElements.getPackageOf (JavacElements.java:439)
    at io.vertx.codegen.CodeGen.lambda$new$0 (CodeGen.java:61)

We should work around this issue and handle the NPE in the filter instead.