Summary: | Quick Fix: IAE n invocation | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Martin Aeschlimann <martinae> |
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P2 | ||
Version: | 2.1 | ||
Target Milestone: | 2.1 RC2 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Martin Aeschlimann
2003-02-25 12:30:19 EST
Problem is that the type biniding for a null binding returns true on 'isPrimitive' for the given code eample, set break point in ASTResolving.getTypeFromTypeBinding(AST, ITypeBinding) line: 432 I will investigate. I fixed it, but in self-hosting workspace now I get: org.eclipse.jdt.internal.corext.Assert$AssertionFailedException: assertion failed; Tries to replace with null (use remove instead) at org.eclipse.jdt.internal.corext.Assert.isTrue(Assert.java:130) at org.eclipse.jdt.internal.corext.dom.ASTRewrite.markAsReplaced(ASTRewrite.java:192) at org.eclipse.jdt.internal.corext.dom.ASTRewrite.markAsReplaced(ASTRewrite.java:210) at org.eclipse.jdt.internal.ui.text.correction.LocalCorrectionsSubProcessor.addCastProposals(LocalCorrectionsSubProcessor.java:94) at org.eclipse.jdt.internal.ui.text.correction.QuickFixProcessor.process(QuickFixProcessor.java:151) at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor.collectCorrections(JavaCorrectionProcessor.java:205) at org.eclipse.jdt.internal.ui.text.correction.CorrectionMarkerResolutionGenerator.getResolutions(CorrectionMarkerResolutionGenerator.java:119) at org.eclipse.ui.internal.registry.MarkerHelpRegistry.getResolutions(MarkerHelpRegistry.java:181) at org.eclipse.ui.views.tasklist.ResolveMarkerAction.getResolutions(ResolveMarkerAction.java:86) at org.eclipse.ui.views.tasklist.ResolveMarkerAction.run(ResolveMarkerAction.java:62) at org.eclipse.jface.action.Action.runWithEvent(Action.java:842) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:456) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent(ActionContributionItem.java:403) at org.eclipse.jface.action.ActionContributionItem.access$0(ActionContributionItem.java:397) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent(ActionContributionItem.java:72) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:836) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1775) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1483) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1271) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1254) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:845) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461) 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:247) at org.eclipse.core.launcher.Main.run(Main.java:703) at org.eclipse.core.launcher.Main.main(Main.java:539) Is this a known problem? Now if typeBinding is the type binding for null, we have: typeBinding.isPrimitive(): false typeBinding.isNullType(): true I think these are the expected answers. So there is something else wrong in the quick fix code. This fix is released in 2.1 head contents of jdt.core. Please take this code and let me know if it works for you. I used the latest jdt.ui head contents to try my fix with your test case. Now we have: isPrimitive() => false isNullType() => true Fixed and released in 2.1 stream. Regression test added. See bug 33683 for the second stack trace. Verified. |