Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 370749

Summary: NPE when changing folder on POM editor
Product: [Eclipse Project] Platform Reporter: Cristiano Gaviao <cvgaviao>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: igor, ob1.eclipse, pwebster, remy.suen
Version: 4.2   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Bug Depends on:    
Bug Blocks: 370757    
Attachments:
Description Flags
tycho projects that contain pom that reproduce the issue. none

Description Cristiano Gaviao CLA 2012-02-06 13:05:15 EST
Build Identifier: I20120127-1145

Sometimes when I'm using the POM editor and I change from "pom.xml" to "Effective POM", then to "Dependency Hierarchy" (actually, there are no such order, just keeping moving from tabs). I got these exception:

java.lang.NullPointerException
	at org.eclipse.core.internal.runtime.AdapterManager.hasAdapter(AdapterManager.java:334)
	at org.eclipse.core.internal.expressions.AdaptExpression.evaluate(AdaptExpression.java:77)
	at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
	at org.eclipse.core.internal.expressions.IterateExpression.evaluate(IterateExpression.java:189)
	at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:93)
	at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:130)
	at org.eclipse.ui.internal.services.EvaluationReference.changed(EvaluationReference.java:124)
	at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:109)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:298)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:312)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.deactivate(EclipseContext.java:613)
	at org.eclipse.ui.part.MultiPageEditorSite.deactivate(MultiPageEditorSite.java:209)
	at org.eclipse.ui.part.MultiPageEditorPart.deactivateSite(MultiPageEditorPart.java:915)
	at org.eclipse.ui.part.MultiPageEditorPart.pageChange(MultiPageEditorPart.java:837)
	at org.eclipse.ui.forms.editor.FormEditor.pageChange(FormEditor.java:492)
	at org.eclipse.m2e.editor.pom.MavenPomEditor.pageChange(MavenPomEditor.java:390)
	at org.eclipse.ui.part.MultiPageEditorPart$2.widgetSelected(MultiPageEditorPart.java:292)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:240)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4135)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1465)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1270)
	at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:2746)
	at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1433)
	at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:257)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4135)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1465)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1270)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3981)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3620)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:999)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:893)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:85)
	at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:579)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:534)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:352)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	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:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:624)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:579)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1433)



java.lang.NullPointerException
	at org.eclipse.ui.internal.PopupMenuExtender.dispose(PopupMenuExtender.java:542)
	at org.eclipse.ui.part.MultiPageEditorSite.dispose(MultiPageEditorSite.java:218)
	at org.eclipse.ui.part.MultiPageEditorPart$9.run(MultiPageEditorPart.java:1018)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.part.MultiPageEditorPart.disposePart(MultiPageEditorPart.java:1013)
	at org.eclipse.ui.part.MultiPageEditorPart.dispose(MultiPageEditorPart.java:504)
	at org.eclipse.ui.forms.editor.FormEditor.dispose(FormEditor.java:395)
	at org.eclipse.m2e.editor.pom.MavenPomEditor.access$8(MavenPomEditor.java:1)
	at org.eclipse.m2e.editor.pom.MavenPomEditor$6.runInUIThread(MavenPomEditor.java:772)
	at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:95)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3945)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3622)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:999)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:893)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:85)
	at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:579)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:534)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:352)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	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:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:624)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:579)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1433)


Reproducible: Always

Steps to Reproduce:
1. Open pom editor
2. keep changing from one tab to another 
3. the pom editor will close with errors
Comment 1 Igor Fedorenko CLA 2012-02-06 14:12:44 EST
I recommend using eclipse 3.8 for the time being.
Comment 2 Remy Suen CLA 2012-02-15 09:10:38 EST
I opened a pom.xml file and pressed Alt+PgDown to scroll through the tabs several times but nothing happened.

Am I doing something wrong? Could someone attach a pom file that will reproduce the problem?
Comment 3 Cristiano Gaviao CLA 2012-02-15 10:42:35 EST
Remy, try to open the pom and then keep clicking it tabs instead of press Alt+PgDown.

regards
Comment 4 Remy Suen CLA 2012-02-15 10:45:15 EST
(In reply to comment #3)
> Remy, try to open the pom and then keep clicking it tabs instead of press
> Alt+PgDown.

Should've mentioned that I tried clicking in comment 2. Clicking on the tabs didn't cause any problems either.
Comment 5 Cristiano Gaviao CLA 2012-02-15 11:11:05 EST
Created attachment 211048 [details]
tycho projects that contain pom that reproduce the issue.

My eclipse is configured to open the pom.xml first.
Then I click on Effective POM, when I click on Dependency Hierarchy 4 error logs are generated.
Comment 6 Remy Suen CLA 2012-02-15 13:47:23 EST
(In reply to comment #5)
> Created attachment 211048 [details]
> tycho projects that contain pom that reproduce the issue.

I see one project and three projects nested within that project (making the total four, technically speaking). Which project(s) should I import, Cristiano?
Comment 7 Cristiano Gaviao CLA 2012-02-15 15:49:13 EST
(In reply to comment #6)
> (In reply to comment #5)
> > Created attachment 211048 [details]
> > tycho projects that contain pom that reproduce the issue.
> 
> I see one project and three projects nested within that project (making the
> total four, technically speaking). Which project(s) should I import, Cristiano?

well, as tycho requires this parent/child structure, just to not have errors on the pom you should import at least the parent and one of its children, test.p2 for example...

I got the same problem in all children...
Comment 8 Remy Suen CLA 2012-02-15 16:21:43 EST
I still cannot reproduce the problem with I20120127-1145. Perhaps the problem is that I'm on Windows.

My m2e install is 1.1.0.20120130-2016.
Comment 9 Remy Suen CLA 2012-02-21 14:21:02 EST
Technically speaking, I can induce the problem if I manually cause an IStructuredSelection implementation to contain a 'null' value in its array but it's not clear to me if this is even valid for IStructuredSelections.
Comment 10 Paul Webster CLA 2012-03-26 14:50:59 EDT
We need to reproduce this so we can figure out where the error is coming from.

Cristiano, should we import all 3 child projects and the parent?

PW
Comment 11 Paul Webster CLA 2012-03-26 15:04:05 EDT
Cristiano's zip can be unzipped and use File>Import...>Maven>Existing Maven projects to import it into M6 with m2e installed.

PW
Comment 12 Paul Webster CLA 2012-03-26 15:17:58 EDT
I can't find this code in M6

org.eclipse.m2e.editor.pom.MavenPomEditor$6.runInUIThread(MavenPomEditor.java:772)

PW
Comment 14 Cristiano Gaviao CLA 2012-03-26 15:57:05 EDT
Hi, I can confirm that the problem is not occurring in M6.

regards and thanks all 

Cristiano
Comment 15 Paul Webster CLA 2012-03-26 17:38:37 EDT
Fixed with M6.  Cristiano, please re-open if you find it happening with M6 and we'll see what we can do.

PW