Hi all,
when calling javac from the ToolProvider, i get a NPE with the jdkb152/b153.

in getLocationForModule(Path), pathLocations can be null 
  Location getLocationForModule(Path dir) {
     return pathLocations.get(dir);
  }

getLocationForModule(String) detects that pathLocations may be null and acts 
accordingly,
but there is no such check in getLocationForModule(Path).

another question is why the behavior of javac is different when calling by the 
ToolProvider than using the main.

cheers,
Rémi

java.lang.NullPointerException
        at 
jdk.compiler/com.sun.tools.javac.file.Locations$OutputLocationHandler.getLocationForModule(Locations.java:556)
        at 
jdk.compiler/com.sun.tools.javac.file.Locations.getLocationForModule(Locations.java:1664)
        at 
jdk.compiler/com.sun.tools.javac.file.JavacFileManager.getLocationForModule(JavacFileManager.java:996)
        at 
jdk.compiler/com.sun.tools.javac.comp.Modules.getModuleLocation(Modules.java:482)
        at 
jdk.compiler/com.sun.tools.javac.comp.Modules.getModuleLocation(Modules.java:465)
        at 
jdk.compiler/com.sun.tools.javac.comp.Modules.setCompilationUnitModules(Modules.java:366)
        at jdk.compiler/com.sun.tools.javac.comp.Modules.enter(Modules.java:265)
        at 
jdk.compiler/com.sun.tools.javac.comp.Modules.initModules(Modules.java:231)
        at 
jdk.compiler/com.sun.tools.javac.main.JavaCompiler.initModules(JavaCompiler.java:1043)
        at 
jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:937)
        at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:307)
        at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:160)
        at 
jdk.compiler/com.sun.tools.javac.main.JavacToolProvider.run(JavacToolProvider.java:46)
        at java.base/java.util.spi.ToolProvider.run(ToolProvider.java:137)
        at 
com.github.forax.pro.plugin.compiler@0.9/com.github.forax.pro.plugin.compiler.CompilerPlugin.compile(CompilerPlugin.java:178)
        at 
com.github.forax.pro.plugin.compiler@0.9/com.github.forax.pro.plugin.compiler.CompilerPlugin.execute(CompilerPlugin.java:108)
        at 
com.github.forax.pro@0.9/com.github.forax.pro.Pro.execute(Pro.java:257)
        at 
com.github.forax.pro@0.9/com.github.forax.pro.Pro.runAll(Pro.java:237)
        at com.github.forax.pro@0.9/com.github.forax.pro.Pro.run(Pro.java:227)
        at 
com.github.forax.pro.main@0.9/com.github.forax.pro.main.JSONConfigRunner.run(JSONConfigRunner.java:68)
        at 
com.github.forax.pro.main@0.9/com.github.forax.pro.main.JSONConfigRunner.lambda$accept$0(JSONConfigRunner.java:22)
        at 
com.github.forax.pro.main@0.9/com.github.forax.pro.main.Main.build(Main.java:122)
        at 
com.github.forax.pro.main@0.9/com.github.forax.pro.main.Main.main(Main.java:166)

Reply via email to