Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 324190 - NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
Summary: NullPointerException in AjBuildManager.findOutputDirsForAspects when compilin...
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.6.10   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 331981 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-09-01 09:15 EDT by Gaël Renoux CLA
Modified: 2011-01-21 11:47 EST (History)
2 users (show)

See Also:


Attachments
pom.xml used to generate the project (3.66 KB, application/xml)
2010-09-01 09:17 EDT, Gaël Renoux CLA
no flags Details
.project (1.11 KB, application/xml)
2010-09-01 09:19 EDT, Gaël Renoux CLA
no flags Details
.classpath (1.44 KB, application/xml)
2010-09-01 09:19 EDT, Gaël Renoux CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gaël Renoux CLA 2010-09-01 09:15:48 EDT
Build Identifier: 20100617-1415

When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : 
java.lang.NullPointerException
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181)
at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements.

Reproducible: Always

Steps to Reproduce:
Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed.

1. Generate a AspectJ project with Maven using the pom.xml I'll join
2. Create an aspect with a few pointcuts and a few advices
3. Compile (not with maven, the Eclipse compilation)
Comment 1 Gaël Renoux CLA 2010-09-01 09:17:33 EDT
Created attachment 177948 [details]
pom.xml used to generate the project
Comment 2 Gaël Renoux CLA 2010-09-01 09:19:40 EDT
Created attachment 177949 [details]
.project
Comment 3 Gaël Renoux CLA 2010-09-01 09:19:53 EDT
Created attachment 177950 [details]
.classpath
Comment 4 Andrew Clement CLA 2010-09-01 11:02:48 EDT
null guard added.
Comment 5 Andrew Clement CLA 2011-01-21 11:47:14 EST
*** Bug 331981 has been marked as a duplicate of this bug. ***