Bug 135573 - CCE in TypeBinding.getPackageFragment
Summary: CCE in TypeBinding.getPackageFragment
Status: RESOLVED DUPLICATE of bug 136016
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-07 11:34 EDT by Markus Keller CLA
Modified: 2006-04-11 10:17 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2006-04-07 11:34:09 EDT
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)
Comment 1 Olivier Thomann CLA 2006-04-07 11:50:27 EDT
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.
Comment 2 Markus Keller CLA 2006-04-07 14:21:57 EDT
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).
Comment 3 Olivier Thomann CLA 2006-04-10 10:15:47 EDT
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?
Comment 4 Jerome Lanneluc CLA 2006-04-10 10:18:10 EDT
sorry, no idea how this can happen
Comment 5 Olivier Thomann CLA 2006-04-10 10:19:40 EDT
Closing as WORKSFORME.
Please reopen if it happens again.
Comment 6 Jerome Lanneluc CLA 2006-04-11 10:17:06 EDT
Reopening as I was able to reproduce with steps from bug 136016
Comment 7 Jerome Lanneluc CLA 2006-04-11 10:17:47 EDT

*** This bug has been marked as a duplicate of 136016 ***