GRECLIPSE
  1. GRECLIPSE
  2. GRECLIPSE-476

Right-click on groovy script and Run as submenu does not popup. Eclipse raises an NPE instead.

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Not A Bug
    • Affects Version/s: 2.0.0m1
    • Fix Version/s: 2.0.0m2
    • Component/s: None
    • Labels:
      None
    • Environment:
      windows xp sp3, eclipse 3.5
    • Number of attachments :
      0

      Description

      Create a new groovy script (no class definitions) then right-click and choose Run As option. The submenu does not popup and sometimes Eclipse IDE raises a:

      An internal error occurred during: "Compute launch button tooltip".
      java.lang.NullPointerException

      The tricky thing is that it sometimes work but I can't find the pattern to identify under which conditions it works or doesn't.

        Activity

        Hide
        Andrew Eisenberg added a comment -

        It would help to see the full stack trace here.

        Is this project a groovy project? It is a known problem that showing the Run As menu will cause an NPE or an AIOOBE for groovy files outside of groovy projects.

        Show
        Andrew Eisenberg added a comment - It would help to see the full stack trace here. Is this project a groovy project? It is a known problem that showing the Run As menu will cause an NPE or an AIOOBE for groovy files outside of groovy projects.
        Hide
        Guillaume Jeudy added a comment -

        yes the project is a groovy project using groovy 1.7 compiler. I enabled the groovy 1.6.5 compiler using the workaround, now i'm at a loss because I can't reproduce the problem anymore.

        stacktrace was:

        !ENTRY org.eclipse.core.jobs 4 2 2009-10-29 09:56:46.669
        !MESSAGE An internal error occurred during: "Compute launch button tooltip".
        !STACK 0
        java.lang.NullPointerException
        at org.testng.eclipse.ui.util.TypeParser.parseType(TypeParser.java:25)
        at org.testng.eclipse.util.TestSearchEngine.isTest(TestSearchEngine.java:221)
        at org.testng.eclipse.launch.tester.JavaTypeExtender.test(JavaTypeExtender.java:31)
        at org.testng.eclipse.launch.tester.TestNGPropertyTester.isTestClass(TestNGPropertyTester.java:30)
        at org.testng.eclipse.launch.tester.TestNGPropertyTester.test(TestNGPropertyTester.java:21)
        at org.eclipse.core.internal.expressions.Property.test(Property.java:58)
        at org.eclipse.core.internal.expressions.TestExpression.evaluate(TestExpression.java:99)
        at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
        at org.eclipse.core.internal.expressions.IterateExpression.evaluate(IterateExpression.java:150)
        at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
        at org.eclipse.core.internal.expressions.WithExpression.evaluate(WithExpression.java:72)
        at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
        at org.eclipse.core.internal.expressions.EnablementExpression.evaluate(EnablementExpression.java:53)
        at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.evalEnablementExpression(LaunchShortcutExtension.java:287)
        at org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager.getShortcutsForSelection(LaunchingResourceManager.java:439)
        at org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager.computeLabels(LaunchingResourceManager.java:224)
        at org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager$2.run(LaunchingResourceManager.java:138)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

        !ENTRY org.eclipse.ui 4 0 2009-10-29 09:56:58.434
        !MESSAGE Unhandled event loop exception
        !STACK 0
        java.lang.NullPointerException
        at org.testng.eclipse.ui.util.TypeParser.parseType(TypeParser.java:25)
        at org.testng.eclipse.util.TestSearchEngine.isTest(TestSearchEngine.java:221)
        at org.testng.eclipse.launch.tester.JavaTypeExtender.test(JavaTypeExtender.java:31)
        at org.testng.eclipse.launch.tester.TestNGPropertyTester.isTestClass(TestNGPropertyTester.java:30)
        at org.testng.eclipse.launch.tester.TestNGPropertyTester.test(TestNGPropertyTester.java:21)
        at org.eclipse.core.internal.expressions.Property.test(Property.java:58)
        at org.eclipse.core.internal.expressions.TestExpression.evaluate(TestExpression.java:99)
        at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
        at org.eclipse.core.internal.expressions.IterateExpression.evaluate(IterateExpression.java:150)
        at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
        at org.eclipse.core.internal.expressions.WithExpression.evaluate(WithExpression.java:72)
        at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
        at org.eclipse.core.internal.expressions.EnablementExpression.evaluate(EnablementExpression.java:53)
        at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.evalEnablementExpression(LaunchShortcutExtension.java:287)
        at org.eclipse.debug.ui.actions.ContextualLaunchAction.isApplicable(ContextualLaunchAction.java:287)
        at org.eclipse.debug.ui.actions.ContextualLaunchAction.fillMenu(ContextualLaunchAction.java:217)
        at org.eclipse.debug.ui.actions.ContextualLaunchAction$1.menuShown(ContextualLaunchAction.java:136)
        at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:235)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1008)
        at org.eclipse.swt.widgets.Control.WM_INITMENUPOPUP(Control.java:4270)
        at org.eclipse.swt.widgets.Control.windowProc(Control.java:3974)
        at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:342)
        at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1578)
        at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2010)
        at org.eclipse.swt.widgets.Display.windowProc(Display.java:4602)
        at org.eclipse.swt.internal.win32.OS.TrackPopupMenu(Native Method)
        at org.eclipse.swt.widgets.Menu._setVisible(Menu.java:254)
        at org.eclipse.swt.widgets.Display.runPopups(Display.java:3906)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3467)
        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)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1287)

        Show
        Guillaume Jeudy added a comment - yes the project is a groovy project using groovy 1.7 compiler. I enabled the groovy 1.6.5 compiler using the workaround, now i'm at a loss because I can't reproduce the problem anymore. stacktrace was: !ENTRY org.eclipse.core.jobs 4 2 2009-10-29 09:56:46.669 !MESSAGE An internal error occurred during: "Compute launch button tooltip". !STACK 0 java.lang.NullPointerException at org.testng.eclipse.ui.util.TypeParser.parseType(TypeParser.java:25) at org.testng.eclipse.util.TestSearchEngine.isTest(TestSearchEngine.java:221) at org.testng.eclipse.launch.tester.JavaTypeExtender.test(JavaTypeExtender.java:31) at org.testng.eclipse.launch.tester.TestNGPropertyTester.isTestClass(TestNGPropertyTester.java:30) at org.testng.eclipse.launch.tester.TestNGPropertyTester.test(TestNGPropertyTester.java:21) at org.eclipse.core.internal.expressions.Property.test(Property.java:58) at org.eclipse.core.internal.expressions.TestExpression.evaluate(TestExpression.java:99) at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53) at org.eclipse.core.internal.expressions.IterateExpression.evaluate(IterateExpression.java:150) at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53) at org.eclipse.core.internal.expressions.WithExpression.evaluate(WithExpression.java:72) at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53) at org.eclipse.core.internal.expressions.EnablementExpression.evaluate(EnablementExpression.java:53) at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.evalEnablementExpression(LaunchShortcutExtension.java:287) at org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager.getShortcutsForSelection(LaunchingResourceManager.java:439) at org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager.computeLabels(LaunchingResourceManager.java:224) at org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager$2.run(LaunchingResourceManager.java:138) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) !ENTRY org.eclipse.ui 4 0 2009-10-29 09:56:58.434 !MESSAGE Unhandled event loop exception !STACK 0 java.lang.NullPointerException at org.testng.eclipse.ui.util.TypeParser.parseType(TypeParser.java:25) at org.testng.eclipse.util.TestSearchEngine.isTest(TestSearchEngine.java:221) at org.testng.eclipse.launch.tester.JavaTypeExtender.test(JavaTypeExtender.java:31) at org.testng.eclipse.launch.tester.TestNGPropertyTester.isTestClass(TestNGPropertyTester.java:30) at org.testng.eclipse.launch.tester.TestNGPropertyTester.test(TestNGPropertyTester.java:21) at org.eclipse.core.internal.expressions.Property.test(Property.java:58) at org.eclipse.core.internal.expressions.TestExpression.evaluate(TestExpression.java:99) at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53) at org.eclipse.core.internal.expressions.IterateExpression.evaluate(IterateExpression.java:150) at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53) at org.eclipse.core.internal.expressions.WithExpression.evaluate(WithExpression.java:72) at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53) at org.eclipse.core.internal.expressions.EnablementExpression.evaluate(EnablementExpression.java:53) at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.evalEnablementExpression(LaunchShortcutExtension.java:287) at org.eclipse.debug.ui.actions.ContextualLaunchAction.isApplicable(ContextualLaunchAction.java:287) at org.eclipse.debug.ui.actions.ContextualLaunchAction.fillMenu(ContextualLaunchAction.java:217) at org.eclipse.debug.ui.actions.ContextualLaunchAction$1.menuShown(ContextualLaunchAction.java:136) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:235) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1008) at org.eclipse.swt.widgets.Control.WM_INITMENUPOPUP(Control.java:4270) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3974) at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:342) at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1578) at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2010) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4602) at org.eclipse.swt.internal.win32.OS.TrackPopupMenu(Native Method) at org.eclipse.swt.widgets.Menu._setVisible(Menu.java:254) at org.eclipse.swt.widgets.Display.runPopups(Display.java:3906) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3467) 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) at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
        Hide
        Andrew Eisenberg added a comment -

        This is a bug in the testng plugin. When the testng plugin is searching for test methods, it asks the Type being tested to return its source code. The specification for this method says that the method may return null. However, the testng plugin does not test for null. And that is why you are seeing the exception.

        I am not exactly sure why the getSource() method for groovy types is returning null on occasion. That is something that I should look at. It likely has something to do with errors during reconciling, but I am not sure.

        Regardless, the root problem is with testng, but there is still something I should look at for groovy-eclipse. I am leaving this bug open for now to see if there is anything I need to change for groovy-eclipse.

        Show
        Andrew Eisenberg added a comment - This is a bug in the testng plugin. When the testng plugin is searching for test methods, it asks the Type being tested to return its source code. The specification for this method says that the method may return null. However, the testng plugin does not test for null. And that is why you are seeing the exception. I am not exactly sure why the getSource() method for groovy types is returning null on occasion. That is something that I should look at. It likely has something to do with errors during reconciling, but I am not sure. Regardless, the root problem is with testng, but there is still something I should look at for groovy-eclipse. I am leaving this bug open for now to see if there is anything I need to change for groovy-eclipse.
        Hide
        Andrew Eisenberg added a comment -

        Submitted patch to testng that fixes this problem:
        http://code.google.com/p/testng-eclipse/issues/detail?id=49

        Show
        Andrew Eisenberg added a comment - Submitted patch to testng that fixes this problem: http://code.google.com/p/testng-eclipse/issues/detail?id=49
        Hide
        Andrew Eisenberg added a comment -

        Not a bug with Groovy-Eclipse...closing.

        Show
        Andrew Eisenberg added a comment - Not a bug with Groovy-Eclipse...closing.

          People

          • Assignee:
            Andrew Eisenberg
            Reporter:
            Guillaume Jeudy
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: