Community
Participate
Working Groups
I converted a project to an AspectJ project and saw an NPE as below. This project DID NOT HAVE a plugin.xml file. java.lang.NullPointerException at org.eclipse.ajdt.internal.core.AJDTUtils.getPDEManifestEditor(AJDTUtils.java:682) at org.eclipse.ajdt.internal.core.AJDTUtils.hasAJPluginDependency(AJDTUtils.java:846) at org.eclipse.ajdt.internal.core.AJDTUtils.addAspectJNature(AJDTUtils.java:204) at org.eclipse.ajdt.internal.ui.actions.AddAJNatureAction.run(AddAJNatureAction.java:50) at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:246) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:842) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2894) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2527) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1570) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1534) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:306) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:228) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:156) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:315) at org.eclipse.core.launcher.Main.basicRun(Main.java:268) at org.eclipse.core.launcher.Main.run(Main.java:942) at org.eclipse.core.launcher.Main.main(Main.java:926)
The fix is to add the following extra check in AJDTUtils.addAspectJNature() and AJDTUtils.removeAspectJNature(): if (project.hasNature(PDE.PLUGIN_NATURE) && PDECore.getDefault().getWorkspaceModelManager() .getWorkspacePluginModel(project) != null) { ... } That way, we only add the plugin dependency if there is a plugin.xml file. Otherwise, we add aspectjrt.jar to the build path.
The fix is in build: BUILD COMPLETE - build.357 Date of build: 05/20/2005 09:13:20 Time to build: 25 minutes 10 seconds Last changed: 05/19/2005 15:40:42 Latest good AJDT build available at update site: http://download.eclipse.org/technology/ajdt/30/dev/update/ Therefore marking this bug as fixed.