Bug 219850 - NPE - CoreOutputLocationManager.java:114
Summary: NPE - CoreOutputLocationManager.java:114
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.5.1   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: 1.6.0 RC1   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-21 14:50 EST by Mike Cepek CLA
Modified: 2008-03-14 16:34 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Cepek CLA 2008-02-21 14:50:00 EST
Build ID: M20080123-0800

Steps To Reproduce:
I had edited a Java class changing the elements defined by a public static enum in that class.  When I saved that class, a few other classes were still referencing some now non-existent elements of that enum, and I got this NPE.

More information:
java.lang.NullPointerException
at java.lang.String.indexOf(String.java:1734)
at java.lang.String.indexOf(String.java:1716)
at org.eclipse.ajdt.internal.core.ajde.CoreOutputLocationManager.getOutputLocationForResource(CoreOutputLocationManager.java:114)
at org.eclipse.ajdt.internal.core.ajde.CoreOutputLocationManager.getOutputLocationForClass(CoreOutputLocationManager.java:106)
at org.aspectj.ajde.core.internal.OutputLocationAdapter.getOutputLocationForClass(OutputLocationAdapter.java:34)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.getOutputClassFileName(AjBuildManager.java:1275)
at org.aspectj.ajdt.internal.compiler.ClassFileBasedByteCodeProvider.unwovenClassFilesFor(ClassFileBasedByteCodeProvider.java:44)
at org.aspectj.ajdt.internal.compiler.InterimCompilationResult.<init>(InterimCompilationResult.java:34)
at org.aspectj.ajdt.internal.compiler.AjPipeliningCompilerAdapter.afterProcessing(AjPipeliningCompilerAdapter.java:370)
at org.aspectj.ajdt.internal.compiler.CompilerAdapter.ajc$after$org_aspectj_ajdt_internal_compiler_CompilerAdapter$5$6b855184(CompilerAdapter.aj:98)
at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:533)
at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:329)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performCompilation(AjBuildManager.java:987)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild(AjBuildManager.java:264)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild(AjBuildManager.java:216)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.incrementalBuild(AjBuildManager.java:187)
at org.aspectj.ajde.core.internal.AjdeCoreBuildManager.doBuild(AjdeCoreBuildManager.java:97)
at org.aspectj.ajde.core.AjCompiler.build(AjCompiler.java:118)
at org.eclipse.ajdt.core.builder.AJBuilder.build(AJBuilder.java:198)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:624)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:166)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:197)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:246)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:249)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:302)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:334)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:137)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

Compile error: NullPointerException thrown: null


Eclipse AspectJ Development Tools
Version: 1.5.1.200801111942
AspectJ version: 1.5.4.20080111211120

Eclipse SDK
Version: 3.3.2
Build id: M20080123-0800

Session Data:
eclipse.buildId=M20080123-0800
java.version=1.6.0_03
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments:  -os win32 -ws win32 -arch x86
Comment 1 Kaj Hejer CLA 2008-03-09 12:47:46 EDT
I too see this stacktrace with eclipse 3.4M5 (I20080207-1530) and ajdt 1.5.1.200801111942.
Comment 2 Andrew Clement CLA 2008-03-10 12:57:41 EDT
In answer to comment #1

> I too see this stacktrace with eclipse 3.4M5 (I20080207-1530) and ajdt
> 1.5.1.200801111942.

AJDT 1.5.1 doesn't really work in 3.4M5, on that level of Eclipse you need to use AJDT 1.6 - dev builds of which are available here:

http://download.eclipse.org/tools/ajdt/34/dev/update

However, this NPE on Eclipse 3.3.2 indicates that the CoreOutputLocationManager has failed to determine the project name (possibly a race condition when it was initialized).  I've put in a guard that will attempt to determine the project name again if it is null and a message will be logged to the AJDT event trace view if we still cannot determine it.  Should be in AJDT 1.5 dev builds shortly. (from the dev update site)
Comment 3 Andrew Clement CLA 2008-03-13 17:32:17 EDT
builds available I believe
Comment 4 Mike Cepek CLA 2008-03-14 14:02:33 EDT
I've downloaded aspectj-DEVELOPMENT-20080228164011.jar, but am unsure what to do with it.  In my 3.3.2 plugins/ directory I have three org.aspectj.xxx/ directories and three org.ajdt.xxx/ directories.  Sorry if I missed some docs somewhere about how to deploy development builds.
Comment 5 Andrew Clement CLA 2008-03-14 14:58:44 EDT
dont download an AspectJ build, just update your installed AJDT to the latest dev build for eclipse 3.3. Update site is:

http://download.eclipse.org/tools/ajdt/33/dev/update

That includes the fix that is in AspectJ.  The repackaging of an AspectJ dev driver into the eclipse plugins isn't straightforward, so I do that and then release AJDT updates through that dev site.
Comment 6 Mike Cepek CLA 2008-03-14 16:34:37 EDT
I've installed that version, restarted Eclipse, and will report back here if I see the same issue recur.  Thanks.