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

Bug 446965

Summary: EditorInputPropertyTester called for IEditorPart with IEditorInput set
Product: [Eclipse Project] Platform Reporter: EPP Error Reports <error-reports-inbox>
Component: UIAssignee: Lars Vogel <Lars.Vogel>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: cedric.brun, daniel_megert, edscollects, Lars.Vogel
Version: 4.4.1Flags: daniel_megert: pmc_approved+
Target Milestone: 4.4.2   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
netbeans none

Description EPP Error Reports CLA 2014-10-13 13:47:38 EDT
A related error report was submitted from the same user at the same time. 

General Information:
    anonymous-id:         8a02a811-1e55-4f7c-b66c-f4f90c87f0c8
    eclipse-build-id:     4.5.0.I20140918-0330
    eclipse-product:      org.eclipse.epp.package.modeling.product
    operating system:     MacOSX 10.9.5 (x86_64) - cocoa
    java-runtime-version: 1.7.0_45-b18

The following plug-ins were present on the execution stack (*):
    1. org.eclipse.core.databinding.observable_1.4.1.v20140910-2107
    2. org.eclipse.core.databinding_1.4.100.v20140910-2107
    3. org.eclipse.core.expressions_3.4.600.v20140128-0851
    4. org.eclipse.core.runtime_3.10.0.v20140724-1132
    5. org.eclipse.e4.core.contexts_1.3.100.v20140407-1019
    6. org.eclipse.e4.ui.workbench_1.2.0.v20140905-1352
    7. org.eclipse.e4.ui.workbench.swt_0.12.100.v20140908-1525
    8. org.eclipse.equinox.app_1.3.200.v20130910-1609
    9. org.eclipse.equinox.launcher_1.3.0.v20140415-2008
    10. org.eclipse.jface_3.11.0.v20140822-0942
    11. org.eclipse.swt_3.104.0.v20140916-1012
    12. org.eclipse.ui_3.107.0.v20140911-1616
    13. org.eclipse.ui.ide.application_1.0.600.v20140909-1818
    14. org.eclipse.ui.ide_3.10.100.v20140905-0917

Error Status:

    code:                   2
    plugin:                 org.eclipse.e4.ui.workbench.swt_0.12.100.v20140908-1525
    message:                Problems occurred when invoking code from plug-in: "org.eclipse.e4.ui.workbench.swt".
    fingerprint:            05c19149
    exception class:        java.lang.NullPointerException
    exception message:      -
    number of children:     0
    
    java.lang.NullPointerException: null
    at org.eclipse.ui.internal.ide.handlers.EditorInputPropertyTester.test(EditorInputPropertyTester.java:45)
    at org.eclipse.core.internal.expressions.Property.test(Property.java:58)
    at org.eclipse.core.internal.expressions.TestExpression.evaluate(TestExpression.java:99)
    at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
    at org.eclipse.core.internal.expressions.WithExpression.evaluate(WithExpression.java:72)
    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.ReferenceExpression.evaluate(ReferenceExpression.java:70)
    at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:98)
    at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:137)
    at org.eclipse.ui.internal.services.EvaluationReference.changed(EvaluationReference.java:131)
    at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:110)
    at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:338)
    at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:352)
    at org.eclipse.ui.internal.services.EvaluationService$1.changed(EvaluationService.java:75)
    at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:110)
    at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:338)
    at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:352)
    at org.eclipse.e4.core.internal.contexts.EclipseContext.activate(EclipseContext.java:635)
    at org.eclipse.e4.core.internal.contexts.EclipseContext.activateBranch(EclipseContext.java:640)
    at org.eclipse.e4.ui.internal.workbench.swt.ShellActivationListener$1.run(ShellActivationListener.java:95)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.e4.ui.internal.workbench.swt.ShellActivationListener.processWindow(ShellActivationListener.java:91)
    at org.eclipse.e4.ui.internal.workbench.swt.ShellActivationListener.handleEvent(ShellActivationListener.java:63)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1087)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4184)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1467)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1490)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1471)
    at org.eclipse.swt.widgets.Shell.windowDidBecomeKey(Shell.java:2167)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5677)
    at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(OS.java:-2)
    at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:214)
    at org.eclipse.swt.widgets.Widget.becomeKeyWindow(Widget.java:366)
    at org.eclipse.swt.widgets.Shell.becomeKeyWindow(Shell.java:525)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5501)
    at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(OS.java:-2)
    at org.eclipse.swt.internal.cocoa.NSWindow.close(NSWindow.java:54)
    at org.eclipse.swt.widgets.Shell.destroyWidget(Shell.java:799)
    at org.eclipse.swt.widgets.Widget.release(Widget.java:1318)
    at org.eclipse.swt.widgets.Control.release(Control.java:2861)
    at org.eclipse.swt.widgets.Widget.dispose(Widget.java:671)
    at org.eclipse.jface.window.Window.close(Window.java:339)
    at org.eclipse.jface.dialogs.Dialog.close(Dialog.java:990)
    at org.eclipse.ui.internal.statushandlers.InternalDialog.close(InternalDialog.java:727)
    at org.eclipse.jface.dialogs.Dialog.okPressed(Dialog.java:950)
    at org.eclipse.jface.dialogs.Dialog.buttonPressed(Dialog.java:466)
    at org.eclipse.ui.internal.statushandlers.InternalDialog.buttonPressed(InternalDialog.java:192)
    at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:619)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4188)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1467)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1490)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1475)
    at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1279)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4031)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3658)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:637)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:580)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:141)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
Comment 1 EPP Error Reports CLA 2014-10-13 13:47:39 EDT
I've looked up the top-3 most similar bug groups and printed the closest bug of
each group below. This report may or may not be duplicate of those (low or sim-
ilar scores for all entries may indicate that this hasn't been reported yet):

>     1. Bug 446621: [wtp] Problems occurred when invoking code from plug-in: "org.eclipse.e4.ui.workben... (err_grp: 1b0fad65) – 131,5    
>     2. Bug 446777: [platform] Unhandled event loop exception (err_grp: 691a7d22) – 99,3    
>     3. Bug 445190: Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench". (err_grp: 386d2f92) – 69,2    


If this report actually is a duplicate of those, please mark it as such. This
information helps me to improve the recommendations further for the next issue.

Thank you for your assistance.
Your friendly error-reports-inbox.
Comment 2 Marcel Bruch CLA 2014-10-14 04:08:09 EDT
*** Bug 446963 has been marked as a duplicate of this bug. ***
Comment 3 EPP Error Reports CLA 2014-10-15 13:29:10 EDT
*** Bug 447182 has been marked as a duplicate of this bug. ***
Comment 4 Lars Vogel CLA 2014-10-24 09:29:18 EDT
Thanks Marcel, I really love your tooling.

Proposed fix.

https://git.eclipse.org/r/35470
Comment 6 Lars Vogel CLA 2014-10-24 09:42:53 EDT
Dani, if you trace down all the duplicates in the other bugs (Marcels algorithm for marking duplicates is unfortunately at the moment really bad) this happens really often. If you think that justifies a downport to 4.4.2, please reopen the bug and retarget it.
Comment 7 Dani Megert CLA 2014-10-24 09:46:48 EDT
(In reply to Lars Vogel from comment #6)
> Dani, if you trace down all the duplicates in the other bugs (Marcels
> algorithm for marking duplicates is unfortunately at the moment really bad)
> this happens really often. If you think that justifies a downport to 4.4.2,
> please reopen the bug and retarget it.

Can you explain why null can be passed? Adding checks without understanding why the problem occurs is wrong.
Comment 8 Lars Vogel CLA 2014-10-24 09:52:12 EDT
(In reply to Dani Megert from comment #7)
> Can you explain why null can be passed? Adding checks without understanding
> why the problem occurs is wrong.

AFAICS init(IEditorSite site, IEditorInput input) throws PartInitException can be called with null, we have no code in our API to prevent that.
Comment 9 Lars Vogel CLA 2014-10-24 09:54:50 EDT
(In reply to Lars Vogel from comment #8)
> AFAICS init(IEditorSite site, IEditorInput input) throws PartInitException
> can be called with null 

IEditorPart / EditorPart in case that was unclear.
Comment 10 Lars Vogel CLA 2014-10-24 12:31:10 EDT
Added logging of the incorrectly configured IEditorPart based on advice from Paul. 

http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=2c00c270418f4007ed978dadf3aa7650bd9daeee

I put this in the queue for a downport to 4.4.2 and let Dani decide if we do this or not.
Comment 11 EPP Error Reports CLA 2014-11-01 03:46:13 EDT
*** Bug 449429 has been marked as a duplicate of this bug. ***
Comment 12 EPP Error Reports CLA 2014-11-01 04:03:10 EDT
*** Bug 449182 has been marked as a duplicate of this bug. ***
Comment 13 EPP Error Reports CLA 2014-11-01 04:03:18 EDT
*** Bug 449181 has been marked as a duplicate of this bug. ***
Comment 14 EPP Error Reports CLA 2014-11-03 22:50:19 EST
*** Bug 449862 has been marked as a duplicate of this bug. ***
Comment 15 EPP Error Reports CLA 2014-11-03 22:50:20 EST
*** Bug 449863 has been marked as a duplicate of this bug. ***
Comment 16 Dani Megert CLA 2014-11-04 09:11:02 EST
(In reply to Lars Vogel from comment #8)
> (In reply to Dani Megert from comment #7)
> > Can you explain why null can be passed? Adding checks without understanding
> > why the problem occurs is wrong.
> 
> AFAICS init(IEditorSite site, IEditorInput input) throws PartInitException
> can be called with null, we have no code in our API to prevent that.

Right, but if that happens, the code in the framework must abort and not make further use of it, like e.g. calling methods.


(In reply to Lars Vogel from comment #10)
> Added logging of the incorrectly configured IEditorPart based on advice from
> Paul. 
> 
> http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/
> ?id=2c00c270418f4007ed978dadf3aa7650bd9daeee

The fix is almost good, but we should not destroy the stack trace (which we had before), and we should dump the editor input class too.
Comment 17 EPP Error Reports CLA 2014-11-05 07:44:18 EST
*** Bug 450087 has been marked as a duplicate of this bug. ***
Comment 18 EPP Error Reports CLA 2014-11-05 07:44:23 EST
*** Bug 450088 has been marked as a duplicate of this bug. ***
Comment 19 EPP Error Reports CLA 2014-11-05 07:44:26 EST
*** Bug 450089 has been marked as a duplicate of this bug. ***
Comment 20 EPP Error Reports CLA 2014-11-05 07:44:30 EST
*** Bug 450090 has been marked as a duplicate of this bug. ***
Comment 21 EPP Error Reports CLA 2014-11-05 07:49:55 EST
*** Bug 450092 has been marked as a duplicate of this bug. ***
Comment 22 EPP Error Reports CLA 2014-11-05 07:49:57 EST
*** Bug 450093 has been marked as a duplicate of this bug. ***
Comment 23 EPP Error Reports CLA 2014-11-05 07:50:03 EST
*** Bug 450094 has been marked as a duplicate of this bug. ***
Comment 24 EPP Error Reports CLA 2014-11-05 07:50:07 EST
*** Bug 450095 has been marked as a duplicate of this bug. ***
Comment 25 EPP Error Reports CLA 2014-11-05 08:31:59 EST
*** Bug 450113 has been marked as a duplicate of this bug. ***
Comment 26 EPP Error Reports CLA 2014-11-05 08:32:01 EST
*** Bug 450114 has been marked as a duplicate of this bug. ***
Comment 27 EPP Error Reports CLA 2014-11-05 08:32:05 EST
*** Bug 450118 has been marked as a duplicate of this bug. ***
Comment 28 EPP Error Reports CLA 2014-11-05 08:32:09 EST
*** Bug 450120 has been marked as a duplicate of this bug. ***
Comment 29 EPP Error Reports CLA 2014-11-05 08:32:13 EST
*** Bug 450122 has been marked as a duplicate of this bug. ***
Comment 30 EPP Error Reports CLA 2014-11-05 08:32:13 EST
*** Bug 450123 has been marked as a duplicate of this bug. ***
Comment 31 EPP Error Reports CLA 2014-11-05 08:32:15 EST
To date this log entry was reported 10 times.

Your friendly error reports bot.
Comment 32 EPP Error Reports CLA 2014-11-06 06:04:27 EST
*** Bug 450256 has been marked as a duplicate of this bug. ***
Comment 33 EPP Error Reports CLA 2014-11-06 06:04:28 EST
*** Bug 450257 has been marked as a duplicate of this bug. ***
Comment 34 EPP Error Reports CLA 2014-11-06 06:04:38 EST
*** Bug 450260 has been marked as a duplicate of this bug. ***
Comment 35 EPP Error Reports CLA 2014-11-06 06:04:41 EST
*** Bug 450262 has been marked as a duplicate of this bug. ***
Comment 36 EPP Error Reports CLA 2014-11-06 06:04:41 EST
*** Bug 450263 has been marked as a duplicate of this bug. ***
Comment 37 EPP Error Reports CLA 2014-11-06 06:04:42 EST
*** Bug 450264 has been marked as a duplicate of this bug. ***
Comment 38 EPP Error Reports CLA 2014-11-06 06:05:28 EST
*** Bug 450268 has been marked as a duplicate of this bug. ***
Comment 39 EPP Error Reports CLA 2014-11-06 07:33:10 EST
*** Bug 450290 has been marked as a duplicate of this bug. ***
Comment 40 EPP Error Reports CLA 2014-11-06 07:33:11 EST
*** Bug 450291 has been marked as a duplicate of this bug. ***
Comment 41 EPP Error Reports CLA 2014-11-06 07:38:30 EST
*** Bug 450296 has been marked as a duplicate of this bug. ***
Comment 42 EPP Error Reports CLA 2014-11-06 07:41:28 EST
*** Bug 450299 has been marked as a duplicate of this bug. ***
Comment 43 EPP Error Reports CLA 2014-11-06 07:41:41 EST
*** Bug 450300 has been marked as a duplicate of this bug. ***
Comment 44 EPP Error Reports CLA 2014-11-06 07:42:06 EST
*** Bug 450301 has been marked as a duplicate of this bug. ***
Comment 45 EPP Error Reports CLA 2014-11-06 07:42:28 EST
*** Bug 450304 has been marked as a duplicate of this bug. ***
Comment 46 EPP Error Reports CLA 2014-11-06 07:44:53 EST
*** Bug 450313 has been marked as a duplicate of this bug. ***
Comment 47 EPP Error Reports CLA 2014-11-06 07:53:01 EST
*** Bug 450321 has been marked as a duplicate of this bug. ***
Comment 48 EPP Error Reports CLA 2014-11-06 07:53:42 EST
*** Bug 450322 has been marked as a duplicate of this bug. ***
Comment 49 EPP Error Reports CLA 2014-11-06 08:01:51 EST
*** Bug 450326 has been marked as a duplicate of this bug. ***
Comment 50 Jeffrey Scott CLA 2014-11-06 10:51:02 EST
Created attachment 248462 [details]
netbeans
Comment 51 Dani Megert CLA 2014-11-14 09:21:06 EST
(In reply to Dani Megert from comment #16)
> The fix is almost good, but we should not destroy the stack trace (which we
> had before), and we should dump the editor input class too.

Lars, can you provide an updated fix? Thanks.
Comment 52 Lars Vogel CLA 2014-11-14 09:28:41 EST
(In reply to Dani Megert from comment #51)
> Lars, can you provide an updated fix? Thanks.

Its in my queue, is this urgent? When do we close 4.2.2?
Comment 53 Dani Megert CLA 2014-11-14 09:52:50 EST
(In reply to Lars Vogel from comment #52)
> (In reply to Dani Megert from comment #51)
> > Lars, can you provide an updated fix? Thanks.
> 
> Its in my queue, is this urgent? When do we close 4.2.2?

https://www.eclipse.org/eclipse/development/plans/freeze_plan_4_4_2.php
Comment 54 Lars Vogel CLA 2014-11-17 07:10:31 EST
(In reply to Dani Megert from comment #16)
> The fix is almost good, but we should not destroy the stack trace (which we
> had before)

Please have a look at this change, I use an IAE instead a NPE, I think it fits better.

https://git.eclipse.org/r/36558

> and we should dump the editor input class too.

How do I do this? input is null, getClass() results in a NPE.
Comment 55 Dani Megert CLA 2014-11-17 09:44:36 EST
(In reply to Lars Vogel from comment #54)
> (In reply to Dani Megert from comment #16)
> > The fix is almost good, but we should not destroy the stack trace (which we
> > had before)
> 
> Please have a look at this change, I use an IAE instead a NPE, I think it
> fits better.

I'd use an NPE, since the argument passed to the method (the editor) is legal, but due to some life-cycle issue, the input is null.


> > and we should dump the editor input class too.
> 
> How do I do this? input is null,

Would have been very cool to see how you do this :-). Silly me!
Comment 56 Lars Vogel CLA 2014-11-17 09:51:20 EST
(In reply to Dani Megert from comment #55)

Gerrit view updated with NPE. If I do not hear from you, I release this  tomorrow and provide a cherry-pick of the changes for the 4.4.2 branch. This will of course only be committed once I get the PMC flag.
Comment 57 Dani Megert CLA 2014-11-17 12:01:14 EST
(In reply to Lars Vogel from comment #56)
> (In reply to Dani Megert from comment #55)
> 
> Gerrit view updated with NPE. If I do not hear from you, I release this 
> tomorrow and provide a cherry-pick of the changes for the 4.4.2 branch. This
> will of course only be committed once I get the PMC flag.

I'd use this for better/nicer log message:

IDEWorkbenchPlugin
.log("IEditorPart (" + editor.getClass() + ") passed in without IEditorInput set", new NullPointerException()); //$NON-NLS-1$ //$NON-NLS-2$
Comment 58 Lars Vogel CLA 2014-11-17 14:31:55 EST
(In reply to Dani Megert from comment #57)
> IDEWorkbenchPlugin
> .log("IEditorPart (" + editor.getClass() + ") passed in without IEditorInput
> set", new NullPointerException()); //$NON-NLS-1$ //$NON-NLS-2$

Merged into master https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=eeaf22c7640c64105498c6f9061784b5d0a1a1db

Backported with https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?h=R4_4_maintenance&id=fd17b44d1f8d4758ffefc98a15b9a7a14bed3f8f
Comment 59 Dani Megert CLA 2014-11-18 07:27:54 EST
(In reply to Lars Vogel from comment #58)
> Backported with
> https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?h=R4_4_maintenance&id=fd17b44d1f8d4758ffefc98a15b9a7a14bed3f8f
> 

Thanks. When backporting, please verify that the bundle version is newer than in 4.4.1. Fixed with http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=3e9038b0897de346f9d101a5c5c16d7b60aad17a