Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE in AjBuildConfig.computeCheckedClasspath #169

Closed
slachiewicz opened this issue Jun 19, 2022 · 2 comments · Fixed by codehaus-plexus/plexus-compiler#228
Closed

NPE in AjBuildConfig.computeCheckedClasspath #169

slachiewicz opened this issue Jun 19, 2022 · 2 comments · Fixed by codehaus-plexus/plexus-compiler#228
Assignees
Labels
question Further information is requested
Milestone

Comments

@slachiewicz
Copy link

I'm working to upgrade aspectj to latest version in https://github.com/codehaus-plexus/plexus-compiler
Unfortunately, starting from version 1.9.8 i got NPE like bellow

[ERROR] org.codehaus.plexus.compiler.ajc.AspectJCompilerTest.testCompilingSources  Time elapsed: 0.516 s  <<< ERROR!
java.lang.NullPointerException: Cannot read the array length because "array" is null
        at java.base/java.util.Arrays.stream(Arrays.java:5428)
        at org.aspectj.ajdt.internal.core.builder.AjBuildConfig.computeCheckedClasspath(AjBuildConfig.java:937)
        at org.aspectj.ajdt.internal.core.builder.AjBuildConfig.getCheckedClasspaths(AjBuildConfig.java:274)
        at org.aspectj.ajdt.internal.core.builder.AjBuildManager.getLibraryAccess(AjBuildManager.java:946)
        at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performCompilation(AjBuildManager.java:1047)
        at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:275)
        at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:188)
        at org.codehaus.plexus.compiler.ajc.AspectJCompiler.compileInProcess(AspectJCompiler.java:474)
        at org.codehaus.plexus.compiler.ajc.AspectJCompiler.performCompile(AspectJCompiler.java:329)

our code below:
https://github.com/codehaus-plexus/plexus-compiler/blob/master/plexus-compilers/plexus-compiler-aspectj/src/main/java/org/codehaus/plexus/compiler/ajc/AspectJCompiler.java#L343

@kriegaex
Copy link
Contributor

Hm, the last substantial commit (disregarding the latest linting commit) in that file was my own. I never looked into Plexus Compiler anymore since then, but hopefully one of these days (maybe not before next weekend) I can spare some private time to take a look. Would that be acceptable?

@kriegaex
Copy link
Contributor

I do not know the AJDT API of AspectJ very well, but I debugged around a bit and sent you a PR in order to fix it in Plexus Compiler. The PR piggy-backs directly on top of your Dependabot PR. Merge it in there, then merge the Dependabot issue, and you should be fine. Or maybe you want to merge my PR directly into master, whatever.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants