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

Bug 366440

Summary: NPE in TypeExtensionManager.getProperty
Product: [Eclipse Project] Platform Reporter: Igor Fedorenko <igor>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: Lars.Vogel, 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    

Description Igor Fedorenko CLA 2011-12-12 12:31:12 EST
When using m2e pom.xml editor with 4.2M4 I fairly frequently get "Internal Error" popup with the following exception written to .log file. Killing Eclipse (and loosing all unsaved work), appears to be the only way to recover.


!ENTRY org.eclipse.e4.ui.workbench 4 0 2011-12-12 12:23:30.142
!MESSAGE Internal Error
!STACK 0
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)
        at org.eclipse.swt.SWT.error(SWT.java:4300)
        at org.eclipse.swt.SWT.error(SWT.java:4215)
        at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:138)
        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:977)
        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:91)
        at org.eclipse.ui.internal.Workbench$3.run(Workbench.java:565)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:520)
        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)
Caused by: java.lang.NullPointerException
        at org.eclipse.core.internal.expressions.TypeExtensionManager.getProperty(TypeExtensionManager.java:95)
        at org.eclipse.core.internal.expressions.TestExpression.evaluate(TestExpression.java:96)
        at org.eclipse.core.internal.expressions.CompositeExpression.evaluateOr(CompositeExpression.java:68)
        at org.eclipse.core.internal.expressions.OrExpression.evaluate(OrExpression.java:21)
        at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
        at org.eclipse.core.internal.expressions.AndExpression.evaluate(AndExpression.java:29)
        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.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
        at org.eclipse.core.internal.expressions.AndExpression.evaluate(AndExpression.java:29)
        at org.eclipse.ui.internal.handlers.HandlerActivation.evaluate(HandlerActivation.java:108)
        at org.eclipse.ui.internal.handlers.LegacyHandlerService$HandlerSelectionFunction.compute(LegacyHandlerService.java:110)
        at org.eclipse.e4.core.internal.contexts.ValueComputation.get(ValueComputation.java:59)
        at org.eclipse.e4.core.internal.contexts.EclipseContext.internalGet(EclipseContext.java:203)
        at org.eclipse.e4.core.internal.contexts.EclipseContext.get(EclipseContext.java:191)
        at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.lookUpHandler(HandlerServiceImpl.java:46)
        at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.canExecute(HandlerServiceImpl.java:99)
        at org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRendererFilter.updateElementVisibility(MenuManagerRendererFilter.java:344)
        at org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRendererFilter.updateElementVisibility(MenuManagerRendererFilter.java:326)
        at org.eclipse.ui.internal.WorkbenchWindow$6.run(WorkbenchWindow.java:562)
        at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
        at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
        ... 23 more
Comment 1 Paul Webster CLA 2011-12-12 12:49:25 EST
Hmmm, which JRE/JVM are you using?

For line 95 I see:
Class clazz= receiver instanceof Class ? (Class)receiver : receiver.getClass();

which AFAICT won't NPE ever.

PW
Comment 2 Igor Fedorenko CLA 2011-12-12 12:54:28 EST
"receiver instanceof Class" is false when reciever==null, which results in attempt to evaluate receiver.getClass() and subsequent NPE.

I am using Apple 1.6

bash-3.2$ java -version
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-10M3527)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)
Comment 3 Paul Webster CLA 2011-12-12 13:00:22 EST
(In reply to comment #2)
> "receiver instanceof Class" is false when reciever==null, which results in
> attempt to evaluate receiver.getClass() and subsequent NPE.

Sorry, you're right.

PW
Comment 4 Paul Webster CLA 2012-03-26 14:44:16 EDT
We still haven't been able to reproduce this.  Can you repo it with the tychodemo project and M6?

PW
Comment 5 Lars Vogel CLA 2013-11-18 07:34:43 EST
Igor, do you still see this in Eclipse 4.3 or Eclipse 4.4? Similar to Paul, I'm unable to reproduce it. I therefore close this bug as fixed. Please reopen if you still see the problem.
Comment 6 Igor Fedorenko CLA 2013-11-18 09:14:14 EST
No, I haven't seen this since 4.2. Thank you for closing this for me.