java.lang.ClassCastException: org.eclipse.core.internal.resources.Folder cannot be cast to org.eclipse.jdt.core.IJavaElement

GitHub | reprogrammer | 6 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    CodingSpectator throws an exception when trying to rename a regular folder

    GitHub | 6 years ago | reprogrammer
    java.lang.ClassCastException: org.eclipse.core.internal.resources.Folder cannot be cast to org.eclipse.jdt.core.IJavaElement

    Root Cause Analysis

    1. java.lang.ClassCastException

      org.eclipse.core.internal.resources.Folder cannot be cast to org.eclipse.jdt.core.IJavaElement

      at org.eclipse.jdt.internal.corext.refactoring.codingspectator.RefactoringGlobalStore.setStructuredSelection()
    2. org.eclipse.jdt
      RefactoringGlobalStore.setStructuredSelection
      1. org.eclipse.jdt.internal.corext.refactoring.codingspectator.RefactoringGlobalStore.setStructuredSelection(RefactoringGlobalStore.java:87)
      1 frame
    3. Java Development Tools UI
      SelectionDispatchAction.run
      1. org.eclipse.jdt.ui.actions.RenameAction.run(RenameAction.java:123)
      2. org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:274)
      3. org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:250)
      3 frames
    4. JFace
      ActionHandler.execute
      1. org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
      2. org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:119)
      2 frames
    5. Commands
      ParameterizedCommand.executeWithChecks
      1. org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
      2. org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
      2 frames
    6. Workbench
      WorkbenchKeyboard$KeyDownFilter.handleEvent
      1. org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
      2. org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468)
      3. org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:786)
      4. org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885)
      5. org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:567)
      6. org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:508)
      7. org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:123)
      7 frames
    7. RWT
      Display.windowProc
      1. org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
      2. org.eclipse.swt.widgets.Display.filterEvent(Display.java:1524)
      3. org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1257)
      4. org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1282)
      5. org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1267)
      6. org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1294)
      7. org.eclipse.swt.widgets.Widget.gtk_key_press_event(Widget.java:730)
      8. org.eclipse.swt.widgets.Control.gtk_key_press_event(Control.java:2841)
      9. org.eclipse.swt.widgets.Composite.gtk_key_press_event(Composite.java:734)
      10. org.eclipse.swt.widgets.Tree.gtk_key_press_event(Tree.java:1977)
      11. org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1743)
      12. org.eclipse.swt.widgets.Control.windowProc(Control.java:4796)
      13. org.eclipse.swt.widgets.Tree.windowProc(Tree.java:3485)
      14. org.eclipse.swt.widgets.Display.windowProc(Display.java:4360)
      14 frames
    8. org.eclipse.swt
      OS.gtk_main_do_event
      1. org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
      2. org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:8189)
      2 frames
    9. RWT
      Display.eventProc
      1. org.eclipse.swt.widgets.Display.eventProc(Display.java:1238)
      1 frame
    10. org.eclipse.swt
      OS.g_main_context_iteration
      1. org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
      2. org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2237)
      2 frames
    11. RWT
      Display.readAndDispatch
      1. org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3159)
      1 frame
    12. Eclipse UI
      Workbench$7.run
      1. org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
      2. org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
      3. org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
      4. org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
      4 frames
    13. Databinding
      Realm.runWithDefault
      1. org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
      1 frame
    14. Eclipse UI
      Workbench.createAndRunWorkbench
      1. org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
      1 frame
    15. Eclipse UI
      PlatformUI.createAndRunWorkbench
      1. org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
      1 frame
    16. Eclipse IDE
      IDEApplication.start
      1. org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
      1 frame
    17. Equinox Container
      EclipseAppHandle.run
      1. org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
      1 frame
    18. Eclipse OSGi
      EclipseStarter.run
      1. org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
      2. org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
      3. org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
      4. org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
      4 frames
    19. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:597)
      4 frames
    20. Equinox
      Main.main
      1. org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
      2. org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
      3. org.eclipse.equinox.launcher.Main.run(Main.java:1408)
      4. org.eclipse.equinox.launcher.Main.main(Main.java:1384)
      4 frames