Project: JDT
Bug 37214 quick fix "add unimplemented methods" failes for anonymous type decl. [quick fix]
Reported: 2003-05-05 09:55:37 | Status: resolved fixed

build 200304291456 1. in a Java editor, create the following class: import java.util.Collections; import java.util.List; public class Main { private void foo() { Collections.sort(new List() { <--- cursor }); } } 2. the anonymous class gets the error and quick fix markers 3. application of the quick fix "add unimplemented methods" failes with an uncaught ClassCastException: java.lang.ClassCastException at org.eclipse.jdt.internal.corext.dom.ASTNodeFactory.newType (ASTNodeFactory.java:74) at org.eclipse.jdt.internal.ui.text.correction.UnimplementedMethodsCompletionPropos al.createNewMethodDeclaration(UnimplementedMethodsCompletionProposal.java:99) at org.eclipse.jdt.internal.ui.text.correction.UnimplementedMethodsCompletionPropos al.getRewrite(UnimplementedMethodsCompletionProposal.java:85) at org.eclipse.jdt.internal.ui.text.correction.ASTRewriteCorrectionProposal.createC ompilationUnitChange(ASTRewriteCorrectionProposal.java:52) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getChange (CUCorrectionProposal.java:85) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getCompilationU nitChange(CUCorrectionProposal.java:225) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getAdditionalPr oposalInfo(CUCorrectionProposal.java:101) at org.eclipse.jface.text.contentassist.AdditionalInfoController.computeInformation (AdditionalInfoController.java:207) at org.eclipse.jface.text.AbstractInformationControlManager.doShowInformation (AbstractInformationControlManager.java:605) at org.eclipse.jface.text.AbstractInformationControlManager.showInformation (AbstractInformationControlManager.java:595) at org.eclipse.jface.text.contentassist.AdditionalInfoController$1.run (AdditionalInfoController.java:164) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:98) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1910) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1644) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1402) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385) 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:291) at org.eclipse.core.launcher.Main.run(Main.java:747) at org.eclipse.core.launcher.Main.main(Main.java:583)

Files changed in fix:
org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/ImportsStructure.java