Summary: | getKey(...) for BinaryMethod returns a key with '.' in the return type instead of '/' | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Marc Guenther <yoda> | ||||||
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||
Severity: | normal | ||||||||
Priority: | P3 | CC: | martinae, philippe_mulet | ||||||
Version: | 3.2.1 | ||||||||
Target Milestone: | 3.2.2 | ||||||||
Hardware: | Macintosh | ||||||||
OS: | Mac OS X - Carbon (unsup.) | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Marc Guenther
2006-10-12 03:54:24 EDT
I can't reproduce the problem. But looking at the code there, it looks like a problem in jdt.core IMethod fTargetMethod= ...; IBinding[] bindings= parser.createBindings(new IJavaElement[] { fTargetMethod }, null); fTargetMethodBinding= ((IMethodBinding) bindings[0]).getMethodDeclaration(); Question to jdt.core: Is there any way that the binding for a IMethod is not a IMethodBinding? Could jdt.core make sure this is always the case an return 'null' otherwise? Could not reproduce. Would it be possible to get reproducable steps based on 3.3M3? Thanks. Closing as REMIND. Please reopen when steps are available. Just reproduced this with a fresh install of 3.3M3. To reproduce: - fresh install of 3.3M3, new workspace - create Java Project - CMD-T (Open Type) the String class - in the Outline view, right click on substring(int) - same Error Panel pops up, this time twice: "An unexpected exception occurred during condition checking..." The Error Log says the following: eclipse.buildId=I20061102-1715 java.version=1.4.2_09 java.vendor=Apple Computer, Inc. BootLoader constants: OS=macosx, ARCH=x86, WS=carbon, NL=en_US Framework arguments: -keyring /Users/marc/.eclipse_keyring -showlocation Command-line arguments: -os macosx -ws carbon -keyring /Users/marc/.eclipse_keyring -consoleLog -showlocation Error Mon Nov 13 22:41:19 CET 2006 Internal Error java.lang.reflect.InvocationTargetException at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:350) at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:479) at org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.run(ProgressMonitorJobsDialog.java:265) at org.eclipse.ui.internal.progress.ProgressManager$3.run(ProgressManager.java:890) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67) at org.eclipse.ui.internal.progress.ProgressManager.busyCursorWhile(ProgressManager.java:925) at org.eclipse.ui.internal.progress.ProgressManager.busyCursorWhile(ProgressManager.java:900) at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.checkInitialConditions(RefactoringWizardOpenOperation.java:157) at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.access$0(RefactoringWizardOpenOperation.java:153) at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation$1.run(RefactoringWizardOpenOperation.java:123) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67) at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:145) at org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter.activate(RefactoringStarter.java:40) at org.eclipse.jdt.internal.corext.refactoring.RefactoringExecutionStarter.startIntroduceIndirectionRefactoring(RefactoringExecutionStarter.java:365) at org.eclipse.jdt.ui.actions.IntroduceIndirectionAction.run(IntroduceIndirectionAction.java:154) at org.eclipse.jdt.ui.actions.IntroduceIndirectionAction.run(IntroduceIndirectionAction.java:118) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:268) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:244) at org.eclipse.jface.action.Action.runWithEvent(Action.java:499) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1508) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1532) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1517) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1291) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3369) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2995) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1924) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1888) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) 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:104) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:74) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:348) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:165) 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.invokeFramework(Main.java:341) at org.eclipse.core.launcher.Main.basicRun(Main.java:285) at org.eclipse.core.launcher.Main.run(Main.java:987) at org.eclipse.core.launcher.Main.main(Main.java:962) Caused by: java.lang.ClassCastException at org.eclipse.jdt.internal.corext.refactoring.code.IntroduceIndirectionRefactoring.checkInitialConditions(IntroduceIndirectionRefactoring.java:428) at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:81) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1742) at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113) Root exception: java.lang.ClassCastException at org.eclipse.jdt.internal.corext.refactoring.code.IntroduceIndirectionRefactoring.checkInitialConditions(IntroduceIndirectionRefactoring.java:428) at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:81) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1742) at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113) Reproduced. I am investigating. Thanks for the test case. In order to reproduce, you need to test it on a method with a return type that is not a primitive type. Update title accordingly. I believe I have a fix for it. Philippe, Might be a good candidate for 3.2.2. Created attachment 53822 [details]
Proposed fix
Added regression test org.eclipse.jdt.core.tests.dom.ASTModelBridgeTests#testCreateBindings19 Created attachment 53824 [details]
Regression test
Released for 3.3M4. +1 for 3.2.2 Reopening for 3.2.2. Released for 3.2.2. Same regression test. Verified for 3.2.2 using build M20070112-1200. |