Community
Participate
Working Groups
Since building against Kepler M6 I'm seeing the following NPE in a unit test, which previously passed: java.lang.NullPointerException at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:3142) at org.eclipse.ui.internal.WorkbenchPage.access$22(WorkbenchPage.java:3048) at org.eclipse.ui.internal.WorkbenchPage$8.run(WorkbenchPage.java:3030) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3026) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2990) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2981) at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:373) at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:179) at org.eclipse.jdt.ui.JavaUI.openInEditor(JavaUI.java:698) at org.eclipse.jdt.ui.JavaUI.openInEditor(JavaUI.java:676) ... In the debugger I see the following sequence of events: 1) inside org.eclipse.jdt.internal.ui.javaeditor.ClassFileEditor.doSetInput() the call to probeInputForSource(input) returns a JavaModelException ("Java Model Status [NonJavaPrj does not exist"). 2) this is rethrown as a CoreException 3) the runnable inside AbstractTextEditor.internalInit rethrows as InvocationTargetException 4) AbstractTextEditor.internalInit rethrows as PartInitException 5) this causes early exit from EditorReference.initialize() which as the second-but-last line *would* assign "legacyPart = part;", but we don't get there. 6) CompatibilityPart.create() catches the exception and goes into handlePartInitException(). 7) inside EditorReference.getSite() we hit NPE because legacyPart is null. 8) after some more rethrowing etc. ReflectionContributionFactory returns null from doCreate() 9) from here all *seems* to be going well, busyOpenEditor() continues its work until the final return compatibilityEditor.getEditor(); where compatibilityEditor is null.
Stephan: what unit test do you see this on? I have some fixes in progress relating to similar problems.
(In reply to comment #1) > Stephan: what unit test do you see this on? I have some fixes in progress > relating to similar problems. It's this test: http://git.eclipse.org/c/objectteams/org.eclipse.objectteams.git/tree/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/callinmarker/CallinMarkerTests.java#n447 The project used in the test is here: http://git.eclipse.org/c/objectteams/org.eclipse.objectteams.git/tree/testplugins/org.eclipse.objectteams.otdt.ui.tests/workspace/NonJavaPrj As the error seems to occurs before actually any Object Teams specifics are involved maybe you can reproduce just with a plain SDK, not sure. Otherwise if you have a fix I'll be happy to re-test against a nightly build or such. Thanks for looking into this.
I suspect this is a duplicate of bug 387475. Stefan, please re-open if you see this still. *** This bug has been marked as a duplicate of bug 387475 ***
Indeed I haven't seen this exception in a while. Great!