Bug 100400 - NPE when launching
Summary: NPE when launching
Status: RESOLVED FIXED
Alias: None
Product: AJDT
Classification: Tools
Component: UI (show other bugs)
Version: 1.2.0   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: 1.2.1   Edit
Assignee: Matt Chapman CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-16 10:07 EDT by John P. A. Verhaeg CLA
Modified: 2005-07-06 12:01 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John P. A. Verhaeg CLA 2005-06-16 10:07:37 EDT
I'm using Eclipse RC2 w/ the latest AJDT development drop, 
1.2.1.20050615132409.  Now, whenever I launch any of the applications in my
workspace, the launch fails with the following stacktrace:

java.lang.NullPointerException
	at
org.eclipse.ajdt.internal.ui.actions.UICoreOperations.sourceFilesChanged(UICoreOperations.java:58)
	at org.eclipse.ajdt.core.builder.AJBuilder.build(AJBuilder.java:168)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:593)
	at
org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1038)
	at org.eclipse.core.runtime.Platform.run(Platform.java:775)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:168)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:202)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:231)
	at
org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1038)
	at org.eclipse.core.runtime.Platform.run(Platform.java:775)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:234)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:303)
	at org.eclipse.core.internal.resources.Project.build(Project.java:106)
	at
org.eclipse.debug.core.model.LaunchConfigurationDelegate.buildProjects(LaunchConfigurationDelegate.java:335)
	at
org.eclipse.debug.core.model.LaunchConfigurationDelegate.buildForLaunch(LaunchConfigurationDelegate.java:94)
	at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:569)
	at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:515)
	at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:733)
	at org.eclipse.debug.internal.ui.DebugUIPlugin$6.run(DebugUIPlugin.java:931)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)
Comment 1 Matt Chapman CLA 2005-06-16 11:33:58 EDT
John,
What exactly are you doing? Debug As > Java Application? From a AspectJ project
presumably. Does the AspectJ project depend on one or more Java projects? It
looks like that could be the problem.
Comment 2 John P. A. Verhaeg CLA 2005-06-16 11:44:06 EDT
This happens running either an Eclipse application or a JUnit test, neither of
which are AspectJ projects, but both have dependencies on AspectJ projects.  We
do have a project (non-AspectJ) that was compiled using JDK 1.3, but due to
different environments that it ran in, contained source code from a few JDK 1.4
classes, which sounds like what you're referring to.
Comment 3 Matt Chapman CLA 2005-06-17 11:08:35 EDT
I've put in a fix for the NPE, and it is available in the latest dev build:

BUILD COMPLETE -  build.415
Date of build: 06/17/2005 11:47:13
Time to build: 21 minutes 9 seconds
Last changed: 06/17/2005 11:30:55
Last log entry: probable fix to bug 100400: NPE when launching

But I don't know whether that is fixing the root cause or just a symptom of
something else, as I haven't been able to reproduce the failure. So it would be
good to hear whether this build fixes things for you, and also can you try
reproducing the problem in a simple testcase that you can attach here? I created
a test Java project depending on an AJ project, but couldn't get the failure.
Comment 4 Helen Beeken CLA 2005-06-20 05:39:58 EDT
I've been able to recreate this NPE under very simple conditions:

Ensure that auto building is on and that you're using Incremental building, then:

(1) Create an AspectJ plugin project 
(2) Create a Java plugin project 
(3) Make the AspectJ plugin have a plugin dependency on the Java plugin
(4) add a white space to the plugin class in the Java Plugin
(5) Save the class by pressing "Ctrl+S"

You will then get a warning in the error log. Expanding the node next to this
warning lists the NPE:

java.lang.NullPointerException
	at
org.eclipse.ajdt.internal.ui.actions.UICoreOperations.sourceFilesChanged(UICoreOperations.java:58)
	at org.eclipse.ajdt.core.builder.AJBuilder.build(AJBuilder.java:168)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:564)
	at
org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:615)
	at org.eclipse.core.runtime.Platform.run(Platform.java:747)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:157)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:249)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:202)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:229)
	at
org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:615)
	at org.eclipse.core.runtime.Platform.run(Platform.java:747)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232)
	at
org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:268)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:297)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:155)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:212)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)


It's slightly different in that I was saving rather than running, but we NPE in
the same place.

(note this is on Eclipse 3.0, in a development environment and with the AJDT
code base of friday 17th June)
Comment 5 Matt Chapman CLA 2005-07-01 05:57:58 EDT
I can't reproduce the NPE using the above steps with the current build.
Comment 6 John P. A. Verhaeg CLA 2005-07-05 12:38:59 EDT
I no longer see the problem either.
Comment 7 Matt Chapman CLA 2005-07-06 12:01:39 EDT
Closing as fixed