scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
232 stars 21 forks source link

"does not exist" errors when using Run As Scala application. #2944

Closed scabug closed 13 years ago

scabug commented 14 years ago

I think this was introduced in r20628. To reproduce, use the r20633 nightly and:

If one reopens the closed project, deletes the file in it, and uses "Run As Scala" application on the remaining file, then a different error is shownr2. For the record, my files were called Foo and Bar and the projects test and test2. That should help with the error messages.

r1

Java Model Exception: Java Model Status [test2 does not exist]
at org.eclipse.jdt.internal.core.JavaElement.newJavaModelException(JavaElement.java:502)
at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:246)
at org.eclipse.jdt.internal.core.Openable.openAncestors(Openable.java:504)
at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:240)
at org.eclipse.jdt.internal.core.Openable.openAncestors(Openable.java:504)
at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:240)
at org.eclipse.jdt.internal.core.Openable.openAncestors(Openable.java:504)
at org.eclipse.jdt.internal.core.CompilationUnit.openAncestors(CompilationUnit.java:1168)
at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:240)
at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:515)
at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:252)
at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:238)
at org.eclipse.jdt.internal.core.JavaElement.getChildren(JavaElement.java:193)
at scala.tools.eclipse.javaelements.ScalaSourceFile.getCorrespondingElement(ScalaSourceFile.scala:93)
at scala.tools.eclipse.javaelements.ScalaSourceFile.getType(ScalaSourceFile.scala:98)
at org.eclipse.jdt.internal.core.CompilationUnit.getHandleFromMemento(CompilationUnit.java:738)
at org.eclipse.jdt.internal.core.JavaElement.getHandleFromMemento(JavaElement.java:273)
at org.eclipse.jdt.internal.core.PackageFragment.getHandleFromMemento(PackageFragment.java:276)
at org.eclipse.jdt.internal.core.JavaElement.getHandleFromMemento(JavaElement.java:273)
at org.eclipse.jdt.internal.core.PackageFragmentRoot.getHandleFromMemento(PackageFragmentRoot.java:445)
at org.eclipse.jdt.internal.core.JavaProject.getHandleFromMemento(JavaProject.java:1524)
at org.eclipse.jdt.internal.core.JavaElement.getHandleFromMemento(JavaElement.java:273)
at org.eclipse.jdt.internal.core.JavaModel.getHandleFromMemento(JavaModel.java:167)
at org.eclipse.jdt.internal.core.JavaElement.getHandleFromMemento(JavaElement.java:273)
at org.eclipse.jdt.core.JavaCore.create(JavaCore.java:2452)
at org.eclipse.jdt.core.JavaCore.create(JavaCore.java:2427)
at org.eclipse.jdt.internal.debug.ui.launcher.DebugTypeSelectionDialog$$DebugTypeSelectionHistory.restoreItemFromMemento(DebugTypeSelectionDialog.java:180)
at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$$SelectionHistory.load(FilteredItemsSelectionDialog.java:2311)
at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$$ContentProvider.loadHistory(FilteredItemsSelectionDialog.java:2813)
at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.restoreDialog(FilteredItemsSelectionDialog.java:382)
at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.createDialogArea(FilteredItemsSelectionDialog.java:789)
at org.eclipse.jdt.internal.debug.ui.launcher.DebugTypeSelectionDialog.createDialogArea(DebugTypeSelectionDialog.java:212)
at org.eclipse.jface.dialogs.Dialog.createContents(Dialog.java:760)
at org.eclipse.jface.window.Window.create(Window.java:431)
at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)
at org.eclipse.ui.dialogs.SelectionStatusDialog.create(SelectionStatusDialog.java:153)
at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.create(FilteredItemsSelectionDialog.java:355)
at org.eclipse.jface.window.Window.open(Window.java:790)
at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.chooseType(JavaLaunchShortcut.java:144)
at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.searchAndLaunch(JavaLaunchShortcut.java:124)
at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.launch(JavaLaunchShortcut.java:246)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.launch(LaunchShortcutExtension.java:434)
at org.eclipse.debug.internal.ui.actions.LaunchShortcutAction.run(LaunchShortcutAction.java:73)
at org.eclipse.debug.internal.ui.actions.LaunchShortcutAction.runWithEvent(LaunchShortcutAction.java:121)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1176)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3493)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3112)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$$4(Workbench.java:2221)
at org.eclipse.ui.internal.Workbench$$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
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:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)

r2

Java Model Exception: Java Model Status [Bar.scala [in test [in src [in test2]]] does not exist]
    at org.eclipse.jdt.internal.core.JavaElement.newJavaModelException(JavaElement.java:502)
    at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:246)
    at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:515)
    at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:252)
    at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:238)
    at org.eclipse.jdt.internal.core.JavaElement.getChildren(JavaElement.java:193)
    at scala.tools.eclipse.javaelements.ScalaSourceFile.getCorrespondingElement(ScalaSourceFile.scala:93)
    at scala.tools.eclipse.javaelements.ScalaSourceFile.getType(ScalaSourceFile.scala:98)
    at org.eclipse.jdt.internal.core.CompilationUnit.getHandleFromMemento(CompilationUnit.java:738)
    at org.eclipse.jdt.internal.core.JavaElement.getHandleFromMemento(JavaElement.java:273)
    at org.eclipse.jdt.internal.core.PackageFragment.getHandleFromMemento(PackageFragment.java:276)
    at org.eclipse.jdt.internal.core.JavaElement.getHandleFromMemento(JavaElement.java:273)
    at org.eclipse.jdt.internal.core.PackageFragmentRoot.getHandleFromMemento(PackageFragmentRoot.java:445)
    at org.eclipse.jdt.internal.core.JavaProject.getHandleFromMemento(JavaProject.java:1524)
    at org.eclipse.jdt.internal.core.JavaElement.getHandleFromMemento(JavaElement.java:273)
    at org.eclipse.jdt.internal.core.JavaModel.getHandleFromMemento(JavaModel.java:167)
    at org.eclipse.jdt.internal.core.JavaElement.getHandleFromMemento(JavaElement.java:273)
    at org.eclipse.jdt.core.JavaCore.create(JavaCore.java:2452)
    at org.eclipse.jdt.core.JavaCore.create(JavaCore.java:2427)
    at org.eclipse.jdt.internal.debug.ui.launcher.DebugTypeSelectionDialog$$DebugTypeSelectionHistory.restoreItemFromMemento(DebugTypeSelectionDialog.java:180)
    at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$$SelectionHistory.load(FilteredItemsSelectionDialog.java:2311)
    at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$$ContentProvider.loadHistory(FilteredItemsSelectionDialog.java:2813)
    at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.restoreDialog(FilteredItemsSelectionDialog.java:382)
    at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.createDialogArea(FilteredItemsSelectionDialog.java:789)
    at org.eclipse.jdt.internal.debug.ui.launcher.DebugTypeSelectionDialog.createDialogArea(DebugTypeSelectionDialog.java:212)
    at org.eclipse.jface.dialogs.Dialog.createContents(Dialog.java:760)
    at org.eclipse.jface.window.Window.create(Window.java:431)
    at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)
    at org.eclipse.ui.dialogs.SelectionStatusDialog.create(SelectionStatusDialog.java:153)
    at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.create(FilteredItemsSelectionDialog.java:355)
    at org.eclipse.jface.window.Window.open(Window.java:790)
    at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.chooseType(JavaLaunchShortcut.java:144)
    at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.searchAndLaunch(JavaLaunchShortcut.java:124)
    at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.launch(JavaLaunchShortcut.java:246)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.launch(LaunchShortcutExtension.java:434)
    at org.eclipse.debug.internal.ui.actions.LaunchShortcutAction.run(LaunchShortcutAction.java:73)
    at org.eclipse.debug.internal.ui.actions.LaunchShortcutAction.runWithEvent(LaunchShortcutAction.java:121)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
    at org.eclipse.jface.action.ActionContributionItem.access$$2(ActionContributionItem.java:501)
    at org.eclipse.jface.action.ActionContributionItem$$5.handleEvent(ActionContributionItem.java:411)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1176)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3493)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3112)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
    at org.eclipse.ui.internal.Workbench.access$$4(Workbench.java:2221)
    at org.eclipse.ui.internal.Workbench$$5.run(Workbench.java:500)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    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:597)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
scabug commented 14 years ago

Imported From: https://issues.scala-lang.org/browse/SI-2944?orig=1 Reporter: @ijuma

scabug commented 14 years ago

@ijuma said: Sorry, seems like I used the wrong mark-up for the bullet points.

scabug commented 14 years ago

@ijuma said: I can confirm that the nightly from the 21st doesn't have this issue. I reverted to that for now as I could not find a way to fix these errors and it's annoying not to be able to launch applications straight from Eclipse. Furthermore, the errors also happen when one exits eclipse. It's like files enter a cache somewhere and are never removed even if the project is closed or the file removed.

scabug commented 14 years ago

@milessabin said: (In r20665) Fixed #2944; cleaned up EclipseFile.equals; review by community.

scabug commented 14 years ago

@ijuma said: Thanks! I have high hopes for tomorrow's nightly. ;)

scabug commented 14 years ago

@ijuma said: I can confirm that this has been fixed.