Bug 49809 - NPE from MethodVerifier
Summary: NPE from MethodVerifier
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M8   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 49209 52561 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-01-10 07:33 EST by Wassim Melhem CLA
Modified: 2004-03-25 12:14 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wassim Melhem CLA 2004-01-10 07:33:40 EST
Build: I-20040106

1. Create a plug-in project.  Choose the one with the sample editor from the 
list.
2. In the manifest editor of the plug-in, go to the dependencies page and 
delete "org.eclipse.ui.workbench.texteditor".
3. Save.
4. The classpath of the project will now update and you will see compilation 
errors as you would expect.

The error marker is as follows, and indicates the error is in 
resource 'EditorPlugin.java'.  This is wrong (problem #1).  If anything, the 
error should be tagged to resource 'XMLEditor.java'
The type org.eclipse.ui.texteditor.StatusTextEditor cannot be resolved. It is 
indirectly referenced from required .class files.
					
					
Problem #2:
I tried to open XMLEditor.java and I got the following NPE:
Error Jan 10, 2004 07:22:25.299 Problems occurred when invoking code from plug-
in: "org.eclipse.core.runtime".
java.lang.NullPointerException
at 
org.eclipse.jdt.internal.compiler.lookup.MethodVerifier.computeInheritedMethods
(MethodVerifier.java:365)
at org.eclipse.jdt.internal.compiler.lookup.MethodVerifier.verify
(MethodVerifier.java:490)
at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.verifyMethods
(SourceTypeBinding.java:1036)
at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.verifyMethods
(CompilationUnitScope.java:599)
at org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.resolve
(HierarchyResolver.java:667)
at org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.resolve
(HierarchyResolver.java:495)
at org.eclipse.jdt.internal.core.hierarchy.HierarchyBuilder.buildSupertypes
(HierarchyBuilder.java:120)
at org.eclipse.jdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.build
(IndexBasedHierarchyBuilder.java:133)
at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.compute
(TypeHierarchy.java:319)
at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.refresh
(TypeHierarchy.java:1234)
at org.eclipse.jdt.internal.core.CreateTypeHierarchyOperation.executeOperation
(CreateTypeHierarchyOperation.java:90)
at org.eclipse.jdt.internal.core.JavaModelOperation.execute
(JavaModelOperation.java:364)
at org.eclipse.jdt.internal.core.JavaModelOperation.run
(JavaModelOperation.java:703)
at org.eclipse.jdt.internal.core.JavaElement.runOperation(JavaElement.java:524)
at org.eclipse.jdt.internal.core.SourceType.newSupertypeHierarchy
(SourceType.java:550)
at org.eclipse.jdt.internal.core.SourceType.newSupertypeHierarchy
(SourceType.java:502)
at 
org.eclipse.jdt.internal.corext.util.SuperTypeHierarchyCache.getTypeHierarchy
(SuperTypeHierarchyCache.java:73)
at org.eclipse.jdt.ui.OverrideIndicatorLabelDecorator.getOverrideIndicators
(OverrideIndicatorLabelDecorator.java:151)
at org.eclipse.jdt.ui.OverrideIndicatorLabelDecorator.computeAdornmentFlags
(OverrideIndicatorLabelDecorator.java:121)
at org.eclipse.jdt.ui.OverrideIndicatorLabelDecorator.decorateImage
(OverrideIndicatorLabelDecorator.java:93)
at org.eclipse.jdt.internal.ui.viewsupport.JavaUILabelProvider.decorateImage
(JavaUILabelProvider.java:119)
at org.eclipse.jdt.internal.ui.viewsupport.JavaUILabelProvider.getImage
(JavaUILabelProvider.java:134)
at org.eclipse.jface.viewers.DecoratingLabelProvider.getImage
(DecoratingLabelProvider.java:73)
at org.eclipse.jdt.internal.ui.viewsupport.DecoratingJavaLabelProvider.getImage
(DecoratingJavaLabelProvider.java:103)
at org.eclipse.jface.viewers.TreeViewer.doUpdateItem(TreeViewer.java:99)
at org.eclipse.jface.viewers.AbstractTreeViewer$UpdateItemSafeRunnable.run
(AbstractTreeViewer.java:87)
at org.eclipse.core.internal.runtime.InternalPlatform.run
(InternalPlatform.java:813)
at org.eclipse.core.runtime.Platform.run(Platform.java:457)
at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem
(AbstractTreeViewer.java:469)
at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run
(StructuredViewer.java:119)
at org.eclipse.core.internal.runtime.InternalPlatform.run
(InternalPlatform.java:813)
at org.eclipse.core.runtime.Platform.run(Platform.java:457)
at org.eclipse.jface.viewers.StructuredViewer.updateItem
(StructuredViewer.java:1285)
at org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem
(AbstractTreeViewer.java:383)
at org.eclipse.jface.viewers.AbstractTreeViewer$1.run
(AbstractTreeViewer.java:363)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:84)
at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren
(AbstractTreeViewer.java:349)
at org.eclipse.jface.viewers.AbstractTreeViewer.internalExpandToLevel
(AbstractTreeViewer.java:926)
at 
org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$JavaOutlineViewer.intern
alExpandToLevel(JavaOutlinePage.java:423)
at org.eclipse.jface.viewers.AbstractTreeViewer.internalExpandToLevel
(AbstractTreeViewer.java:935)
at 
org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$JavaOutlineViewer.intern
alExpandToLevel(JavaOutlinePage.java:423)
at org.eclipse.jface.viewers.AbstractTreeViewer$5.run
(AbstractTreeViewer.java:809)
at org.eclipse.jface.viewers.StructuredViewer.preservingSelection
(StructuredViewer.java:810)
at org.eclipse.jface.viewers.AbstractTreeViewer.inputChanged
(AbstractTreeViewer.java:798)
at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:238)
at org.eclipse.jface.viewers.StructuredViewer.setInput
(StructuredViewer.java:1004)
at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage.createControl
(JavaOutlinePage.java:1056)
at org.eclipse.ui.views.contentoutline.ContentOutline.doCreatePage
(ContentOutline.java:125)
at org.eclipse.ui.part.PageBookView.createPage(PageBookView.java:306)
at org.eclipse.ui.part.PageBookView.partActivated(PageBookView.java:561)
at org.eclipse.ui.internal.PartListenerList$1.run(PartListenerList.java:49)
at org.eclipse.core.internal.runtime.InternalPlatform.run
(InternalPlatform.java:813)
at org.eclipse.core.runtime.Platform.run(Platform.java:457)
at org.eclipse.ui.internal.PartListenerList.firePartActivated
(PartListenerList.java:47)
at org.eclipse.ui.internal.WorkbenchPage.firePartActivated
(WorkbenchPage.java:1251)
at org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:2513)
at org.eclipse.ui.internal.WorkbenchPage.activate(WorkbenchPage.java:448)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor
(WorkbenchPage.java:2061)
at org.eclipse.ui.internal.WorkbenchPage.access$6(WorkbenchPage.java:1990)
at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:1977)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:84)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:1972)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:265)
at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor
(EditorUtility.java:133)
at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor
(EditorUtility.java:111)
at org.eclipse.jdt.internal.ui.actions.OpenActionUtil.open
(OpenActionUtil.java:49)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:158)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:147)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun
(SelectionDispatchAction.java:212)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run
(SelectionDispatchAction.java:188)
at 
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen
(PackageExplorerActionGroup.java:329)
at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$5.open
(PackageExplorerPart.java:334)
at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:406)
at org.eclipse.core.internal.runtime.InternalPlatform.run
(InternalPlatform.java:813)
at org.eclipse.core.runtime.Platform.run(Platform.java:457)
at org.eclipse.jface.viewers.StructuredViewer.fireOpen
(StructuredViewer.java:404)
at org.eclipse.jface.viewers.StructuredViewer.handleOpen
(StructuredViewer.java:614)
at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen
(StructuredViewer.java:703)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:209)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:204)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:233)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:847)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2311)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1992)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1506)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1482)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:246)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:139)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:47)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run
(PlatformActivator.java:226)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:85)
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:324)
at org.eclipse.core.launcher.Main.basicRun(Main.java:279)
at org.eclipse.core.launcher.Main.run(Main.java:742)
at org.eclipse.core.launcher.Main.main(Main.java:581)
Comment 1 Kent Johnson CLA 2004-01-26 17:10:32 EST
Can you still reproduce this problem?

I tried & didn't get the NPE.
Comment 2 Wassim Melhem CLA 2004-01-26 17:22:39 EST
Just got the exact same behavior on I-20040121.

When creating the sample plug-ins, don't select the multipage editor, choose 
the fifth one in the list of templates, i.e. the single-page editor
Comment 3 Kent Johnson CLA 2004-02-17 15:04:38 EST
Was never able to reproduce but added protection against superinterfaces() 
returning null.
Comment 4 Philipe Mulet CLA 2004-02-17 18:36:13 EST
Wassim - which JRE did you run Eclipse on top of ?
Comment 5 Wassim Melhem CLA 2004-02-17 20:07:16 EST
Sun's 1.4.2
Exact steps that I wrote above can reproduce the NPE on M7.

As for the other problem:
>The error marker is as follows, and indicates the error is in 
>resource 'EditorPlugin.java'.  This is wrong (problem #1).  If anything, the 
>error should be tagged to resource 'XMLEditor.java'
This one is fixed.  Philippe, I believe this wrong tagging is related to the 
bug we had with org.eclipse.osgi, which you did fix some time ago.
Comment 6 Philipe Mulet CLA 2004-02-19 18:24:00 EST
*** Bug 52561 has been marked as a duplicate of this bug. ***
Comment 7 Kent Johnson CLA 2004-02-20 13:09:02 EST
Problem #2 is not a MethodVerifier problem.

The HierarchyResolver is not handling the case of a busted classpath. It 
doesn't need to call the verifier but even if didn't, it still aborts when 
resolving the hierarchy.

Just try to open an editor on XMLEditor (after breaking the classpath as 
instructed).
Comment 8 Jerome Lanneluc CLA 2004-02-25 10:18:54 EST
Removed useless call to method verifier. Also changed HierarchyResolver to not 
resolve if an AbortCompilation happens while completing type bindings.

Added regression test TypeHierarchyTests.testSuperTypeHierarchyMissingBinary()
Comment 9 Jerome Lanneluc CLA 2004-03-04 07:37:00 EST
*** Bug 49209 has been marked as a duplicate of this bug. ***
Comment 10 Frederic Fusier CLA 2004-03-25 12:14:06 EST
Verified for 3.0 using build I200403250800.