Bug 352605 - Eclipse is reporting "Could not retrieve superclass" every few minutes
Summary: Eclipse is reporting "Could not retrieve superclass" every few minutes
Status: VERIFIED FIXED
Alias: None
Product: Objectteams
Classification: Tools
Component: OTJ (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 2.0.1   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard: Also released in 2.1 M1
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-20 11:19 EDT by Peter Steele CLA
Modified: 2011-08-21 11:10 EDT (History)
2 users (show)

See Also:


Attachments
test & fix (6.24 KB, patch)
2011-08-02 04:40 EDT, Stephan Herrmann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Steele CLA 2011-07-20 11:19:53 EDT
What steps will reproduce the problem?
1. At this point it happens periodically while editing. Restarting Eclipse does not help. I'm not 100% sure what editor action causes the issue, but I usually notice it has happened because the editor hangs briefly and the window's title bar reports "Not responding".
2. I am running against a NFS mounted drive (using Windows NFS client service). The source files are on a Linux box where I do my builds manually via an ssh session.
3. I also have CDT, EPIC and PyDev installed.

I am going to uninstall everything and see if the problem recurs in a clean environment.

-- Error Details --
Date: Tue Jul 19 14:10:02 PDT 2011
Message: Could not retrieve superclass
Severity: Error
Product: Eclipse 1.4.0.20110609-1120 (org.eclipse.epp.package.java.product)
Plugin: org.eclipse.jdt.core
Session Data:
eclipse.buildId=I20110613-1736
java.version=1.6.0_21
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -data C:\Users\psteele\Eclipse-remote -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product

Exception Stack Trace:
java.lang.NullPointerException
	at org.eclipse.objectteams.otdt.internal.core.compiler.control.Config.setSourceTypeRequired(Config.java:327)
	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:179)
	at org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding.resolve(UnresolvedReferenceBinding.java:57)
	at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveType(BinaryTypeBinding.java:240)
	at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.superclass(BinaryTypeBinding.java:1561)
	at org.eclipse.jdt.core.dom.TypeBinding.getSuperclass(TypeBinding.java:905)
	at org.eclipse.jdt.internal.ui.text.correction.UnresolvedElementsSubProcessor.hasFieldWithName(UnresolvedElementsSubProcessor.java:522)
	at org.eclipse.jdt.internal.ui.text.correction.UnresolvedElementsSubProcessor.addSimilarVariableProposals(UnresolvedElementsSubProcessor.java:454)
	at org.eclipse.jdt.internal.ui.text.correction.UnresolvedElementsSubProcessor.getVariableProposals(UnresolvedElementsSubProcessor.java:252)
	at org.eclipse.jdt.internal.ui.text.correction.QuickFixProcessor.process(QuickFixProcessor.java:297)
	at org.eclipse.jdt.internal.ui.text.correction.QuickFixProcessor.getCorrections(QuickFixProcessor.java:252)
	at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor$SafeCorrectionCollector.safeRun(JavaCorrectionProcessor.java:378)
	at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor$SafeCorrectionProcessorAccess.run(JavaCorrectionProcessor.java:339)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor$SafeCorrectionProcessorAccess.process(JavaCorrectionProcessor.java:335)
	at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor.collectCorrections(JavaCorrectionProcessor.java:468)
	at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor.collectProposals(JavaCorrectionProcessor.java:280)
	at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor.computeQuickAssistProposals(JavaCorrectionProcessor.java:242)
	at org.eclipse.jface.text.quickassist.QuickAssistAssistant$ContentAssistProcessor.computeCompletionProposals(QuickAssistAssistant.java:75)
	at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1830)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:556)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:553)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:488)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:482)
	at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1656)
	at org.eclipse.jface.text.quickassist.QuickAssistAssistant.showPossibleQuickAssists(QuickAssistAssistant.java:128)
	at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionAssistant.showPossibleQuickAssists(JavaCorrectionAssistant.java:193)
	at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:195)
	at org.eclipse.jdt.internal.ui.javaeditor.JavaSelectAnnotationRulerAction.runWithEvent(JavaSelectAnnotationRulerAction.java:98)
	at org.eclipse.ui.texteditor.AbstractRulerActionDelegate.runWithEvent(AbstractRulerActionDelegate.java:112)
	at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:241)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	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:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Comment 1 Stephan Herrmann CLA 2011-07-21 04:14:24 EDT
Peter,

as Dani correctly noticed, the bug doesn't occur in a plain JDT but you
have (part of) the Object Teams Development Tooling installed, which ships 
a variant of the org.eclipse.jdt.core plug-in.

Since you didn't list the OTDT in your list of feature you might have
installed it by accident and uninstalling the OTDT should fix the issue 
for you. To do so please look for the feature called
 "Object Teams Patch for JDT/Core"
After uninstalling you may verify that you are back to the original JDT/Core
by looking for this plugin:
 id: org.eclipse.jdt.core
 version: 3.7.0.v_B61

OTOH, the OTDT is intended to be fully compatible. For the Object Teams 
Project it would be valuable if you could give more details how to
reproduce (and then fix) the problem.
Thanks.
Comment 2 Peter Steele CLA 2011-07-21 12:56:46 EDT
I was unaware OTDT was installed. I just recently upgraded to Indigo and it likely got included when I was installing other things. I removed this component and the problem appears to have gone away.

As for reproducing it, I don't really have any good information. Prior to removing the OTDO component, the exception would simply occur periodically while I was editing. I didn't see any particular pattern in what I was doing at the time when this error would occur.
Comment 3 Stephan Herrmann CLA 2011-08-02 04:40:47 EDT
Created attachment 200691 [details]
test & fix

I found a way to reproduce the log entry, which requires a binary type
binding whose super class is a source type binding.
In this specific case the OT/J compiler missed some necessary setup
before calling into ReferenceBinding.superclass() which can trigger
LookupEnvironment.askForType(..), where things went bad.

Fixed by bracketing three more locations in TypeBinding with
Dependencies.{setup,release}.
Comment 4 Stephan Herrmann CLA 2011-08-02 04:43:10 EDT
Committed for 2.0.1
Comment 5 Stephan Herrmann CLA 2011-08-17 12:08:29 EDT
Verified for 2.0.1 using build 201108160141.