Community
Participate
Working Groups
N20060407-0010 Invoke quick fix on the error in the class below -> CCE, adding unimplemented methods does not work. import org.eclipse.jface.viewers.IOpenListener; public class Test { private final class TestOpenListener implements IOpenListener { } } Steps to reproduce: - import org.eclipse.jface as binary plugin - create a new Java Project with src folder - add project org.eclipse.jface to build path - create class above and press Ctrl+1 on the line with error java.lang.ClassCastException: org.eclipse.jdt.internal.core.JavaProject at org.eclipse.jdt.core.dom.TypeBinding.getPackageFragment(TypeBinding.java:648) at org.eclipse.jdt.core.dom.TypeBinding.getClassFile(TypeBinding.java:130) at org.eclipse.jdt.core.dom.TypeBinding.getUnresolvedJavaElement(TypeBinding.java:483) at org.eclipse.jdt.core.dom.TypeBinding.getUnresolvedJavaElement(TypeBinding.java:408) at org.eclipse.jdt.core.dom.TypeBinding.getJavaElement(TypeBinding.java:401) at org.eclipse.jdt.core.dom.MethodBinding.getUnresolvedJavaElement(MethodBinding.java:200) at org.eclipse.jdt.core.dom.MethodBinding.getJavaElement(MethodBinding.java:193) at org.eclipse.jdt.internal.corext.codemanipulation.StubUtility2.suggestArgumentNames(StubUtility2.java:916) at org.eclipse.jdt.internal.corext.codemanipulation.StubUtility2.createParameters(StubUtility2.java:551) at org.eclipse.jdt.internal.corext.codemanipulation.StubUtility2.createImplementationStub(StubUtility2.java:397) at org.eclipse.jdt.internal.ui.text.correction.UnimplementedMethodsCompletionProposal.getRewrite(UnimplementedMethodsCompletionProposal.java:85) at org.eclipse.jdt.internal.ui.text.correction.ASTRewriteCorrectionProposal.addEdits(ASTRewriteCorrectionProposal.java:90) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.createTextChange(CUCorrectionProposal.java:294) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.createChange(CUCorrectionProposal.java:303) at org.eclipse.jdt.internal.ui.text.correction.ChangeCorrectionProposal.getChange(ChangeCorrectionProposal.java:207) at org.eclipse.jdt.internal.ui.text.correction.ChangeCorrectionProposal.performChange(ChangeCorrectionProposal.java:100) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.apply(CUCorrectionProposal.java:244) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertProposal(CompletionProposalPopup.java:725) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertSelectedProposalWithMask(CompletionProposalPopup.java:671) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.verifyKey(CompletionProposalPopup.java:1084) at org.eclipse.jface.text.contentassist.ContentAssistant$InternalListener.verifyKey(ContentAssistant.java:647) at org.eclipse.jface.text.TextViewer$VerifyKeyListenersManager.verifyKey(TextViewer.java:404) at org.eclipse.swt.custom.StyledTextListener.handleEvent(StyledTextListener.java:61) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:925) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:949) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:934) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:706) at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5065) at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:4806) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:925) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:949) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:934) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:962) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:958) at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1272) at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3346) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3246) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4023) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1920) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2964) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:169) 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:585) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) at org.eclipse.core.launcher.Main.basicRun(Main.java:280) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952)
Works for me. I get: public void open(OpenEvent event) { // TODO Auto-generated method stub } added in the TestOpenListener class. I am also using N20060407-0010.
Darn! I didn't make up that exception... I also cannot reproduce any more. When it happened, I could easily reproduce. OK to close (unless you see in the code how this could occur, or you want to add a check for this case).
Jérôme, Do you see how this would be possible? I could not reproduce the failure. Would you recommend that a check is added?
sorry, no idea how this can happen
Closing as WORKSFORME. Please reopen if it happens again.
Reopening as I was able to reproduce with steps from bug 136016
*** This bug has been marked as a duplicate of 136016 ***