Project: JDT
Bug 38467 Delete: ClassCastException when deleting from a class folder
Reported: 2003-06-05 05:47:14 | Status: resolved fixed

20030604 1. create Java project, add a class folder 'cf' 2. Copy a file A.class inside the class folder 3. delete the class file Same when deleting the default package or the class folder itself java.lang.reflect.InvocationTargetException at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:313) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:252) at org.eclipse.jdt.internal.ui.refactoring.RefactoringWizardDialog2.run(RefactoringWizardDialog2.java:271) at org.eclipse.jdt.internal.ui.refactoring.PerformRefactoringUtil.performRefactoring(PerformRefactoringUtil.java:53) at org.eclipse.jdt.internal.ui.refactoring.RefactoringWizard.performFinish(RefactoringWizard.java:371) at org.eclipse.jdt.internal.ui.refactoring.UserInputWizardPage.performFinish(UserInputWizardPage.java:119) at org.eclipse.jdt.internal.ui.refactoring.RefactoringWizard.performFinish(RefactoringWizard.java:434) at org.eclipse.jdt.internal.ui.refactoring.RefactoringWizardDialog2.okPressed(RefactoringWizardDialog2.java:395) at org.eclipse.jface.dialogs.Dialog.buttonPressed(Dialog.java:256) at org.eclipse.jface.dialogs.Dialog$1.widgetSelected(Dialog.java:423) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:848) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2034) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1741) at org.eclipse.jface.window.Window.runEventLoop(Window.java:583) at org.eclipse.jface.window.Window.open(Window.java:563) at org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter.activate(RefactoringStarter.java:55) at org.eclipse.jdt.internal.corext.refactoring.reorg2.DeleteAction.startRefactoring(DeleteAction.java:124) at org.eclipse.jdt.internal.corext.refactoring.reorg2.DeleteAction.run(DeleteAction.java:109) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:191) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:169) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleKeyEvent(PackageExplorerActionGroup.java:340) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$9.keyReleased(PackageExplorerPart.java:920) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:124) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:848) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2034) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1741) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1399) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1382) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:858) 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) Caused by: java.lang.ClassCastException at org.eclipse.jdt.internal.corext.refactoring.reorg2.DeleteRefactoring2$ReadOnlyResourceFinder.getReadOnlyResourcesAndSubResources(DeleteRefactoring2.java:801) at org.eclipse.jdt.internal.corext.refactoring.reorg2.DeleteRefactoring2$ReadOnlyResourceFinder.getReadOnlyResourcesAndSubResources(DeleteRefactoring2.java:792) at org.eclipse.jdt.internal.corext.refactoring.reorg2.DeleteRefactoring2$ReadOnlyResourceFinder.getReadOnlyResourcesAndSubResources(DeleteRefactoring2.java:822) at org.eclipse.jdt.internal.corext.refactoring.reorg2.DeleteRefactoring2$ReadOnlyResourceFinder.getReadOnlyResourcesAndSubResources(DeleteRefactoring2.java:792) at org.eclipse.jdt.internal.corext.refactoring.reorg2.DeleteRefactoring2$ReadOnlyResourceFinder.getReadOnlyResourcesAndSubResources(DeleteRefactoring2.java:783) at org.eclipse.jdt.internal.corext.refactoring.reorg2.DeleteRefactoring2.confirmDeletingReadOnly(DeleteRefactoring2.java:400) at org.eclipse.jdt.internal.corext.refactoring.reorg2.DeleteRefactoring2.recalculateElementsToDelete(DeleteRefactoring2.java:182) at org.eclipse.jdt.internal.corext.refactoring.reorg2.DeleteRefactoring2.checkInput(DeleteRefactoring2.java:149) at org.eclipse.jdt.internal.ui.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:65) at org.eclipse.jdt.internal.ui.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:100) at org.eclipse.jdt.internal.ui.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:138) at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:302) ... 39 more

Files changed in fix:
org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg2/DeleteRefactoring2.java