Project: JDT
Bug 408124 [refactoring] CCE with Extract Class refactoring on a class with comment
Reported: 2013-05-15 09:01:01 | Status: verified fixed

Perform Refactor > Extract Class... on the following example: // comment public class Test { int i; } We get this exception: java.lang.reflect.InvocationTargetException at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:421) at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.run(RefactoringWizardDialog2.java:331) ... Caused by: java.lang.ClassCastException: org.eclipse.jdt.core.dom.CompilationUnit cannot be cast to org.eclipse.jdt.core.dom.TypeDeclaration at org.eclipse.jdt.internal.corext.refactoring.structure.ExtractClassRefactoring.createParameterObject(ExtractClassRefactoring.java:479)

Files changed in fix:
org.eclipse.jdt.ui.tests.refactoring/resources/ExtractClass/testComment/in/Comment.java org.eclipse.jdt.ui.tests.refactoring/resources/ExtractClass/testComment/out/Comment.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractClassTests.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ExtractClassRefactoring.java