NullPointerException in Modules#checkCyclicDependencies()

Gunnar Morling gunnar at hibernate.org
Tue May 31 09:11:53 UTC 2016


Hi Alan,

I could narrow down the trigger for this issue: It's related to referring a
non-existing module in module-info.java.

Normally, that error is detected by javac which emits a correct compilation
error:

    src/main/java/module-info.java:4: error: module not found: xyz

But when specifying the -processorpath option, this check seems to be
bypassed somehow. The code in Modules#checkCyclicDependencies() then fails
with an NPE as the "directive" of the JCRequires is null (see [1]).

That's the module-info.java:

    module foo {
        requires nonexistent;
    }

And that's the javac invocation:

    javac -processorpath someprocessor.jar -d mods/npe-test $(find
src/main/java -name "*.java")

Please let me know if you need any further information.

--Gunnar

[1] https://paste.fedoraproject.org/372855/





2016-05-30 17:51 GMT+02:00 Alan Bateman <Alan.Bateman at oracle.com>:

>
>
> On 30/05/2016 16:44, Gunnar Morling wrote:
>
>> Hi,
>>
>> I'm getting a NullPointerException at the following line:
>>
>> com.sun.tools.javac.comp.Modules.checkCyclicDependencies(jdk.compiler at 9-ea
>> /Modules.java:1222
>>
>> I'm getting this from an existing code base which I'm trying to Jigsaw-ify
>> (Hibernate Validator). I can try and narrow it down to a potential cause
>> but thought I'd reach out and check whether this rings a bell for anyone
>> before spending more time on it.
>>
>> I can't find any bug reports on this so if you have a small test or even
> the stack trace then it would be good and we'll create a bug for this.
>
> -Alan
>


More information about the jigsaw-dev mailing list