GRECLIPSE
  1. GRECLIPSE
  2. GRECLIPSE-914

NPE During Organize Imports whilst editing a script

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.0Release
    • Fix Version/s: 2.1.1Release
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Got the following NPE whilst editing _PluginDependencies.groovy after activating the Organize imports feature

      
      java.lang.NullPointerException
      at org.codehaus.groovy.eclipse.refactoring.actions.OrganizeGroovyImports$FindUnresolvedReferencesVisitor.visitClosureExpression(OrganizeGroovyImports.java:177)
      at org.codehaus.groovy.ast.expr.ClosureExpression.visit(ClosureExpression.java:46)
      at org.codehaus.groovy.ast.CodeVisitorSupport.visitBinaryExpression(CodeVisitorSupport.java:144)
      at org.codehaus.groovy.ast.expr.BinaryExpression.visit(BinaryExpression.java:49)
      at org.codehaus.groovy.ast.CodeVisitorSupport.visitExpressionStatement(CodeVisitorSupport.java:69)
      at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitExpressionStatement(ClassCodeVisitorSupport.java:209)
      at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:40)
      at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:35)
      at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:179)
      at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:51)
      at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:102)
      at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:113)
      at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:124)
      at org.codehaus.groovy.eclipse.refactoring.actions.OrganizeGroovyImports$FindUnresolvedReferencesVisitor.visitMethod(OrganizeGroovyImports.java:160)
      at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1097)
      at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:51)
      at org.codehaus.groovy.eclipse.refactoring.actions.OrganizeGroovyImports$FindUnresolvedReferencesVisitor.visitClass(OrganizeGroovyImports.java:172)
      at org.codehaus.groovy.eclipse.refactoring.actions.OrganizeGroovyImports.calculateMissingImports(OrganizeGroovyImports.java:314)
      at org.codehaus.groovy.eclipse.refactoring.actions.OrganizeGroovyImports.calculateAndApplyMissingImports(OrganizeGroovyImports.java:405)
      at org.codehaus.groovy.eclipse.refactoring.actions.OrganizeGroovyImportsAction.run(OrganizeGroovyImportsAction.java:82)
      at org.eclipse.jdt.ui.actions.OrganizeImportsAction.run(OrganizeImportsAction.java:201)
      at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:278)
      at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:250)
      at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
      at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:185)
      at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHandlerWrapper.java:109)
      at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
      at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
      at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
      at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468)
      at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:786)
      at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885)
      at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:567)
      at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:508)
      at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:123)
      at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
      at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1031)
      at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3775)
      at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1367)
      at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1390)
      at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1375)
      at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1404)
      at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1400)
      at org.eclipse.swt.widgets.Canvas.sendKeyEvent(Canvas.java:416)
      at org.eclipse.swt.widgets.Control.doCommandBySelector(Control.java:958)
      at org.eclipse.swt.widgets.Display.windowProc(Display.java:5068)
      at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
      at org.eclipse.swt.internal.cocoa.NSResponder.interpretKeyEvents(NSResponder.java:56)
      at org.eclipse.swt.widgets.Composite.keyDown(Composite.java:587)
      at org.eclipse.swt.widgets.Display.windowProc(Display.java:4978)
      at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
      at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:220)
      at org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:1943)
      at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2025)
      at org.eclipse.swt.widgets.Display.windowProc(Display.java:5040)
      at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
      at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:4582)
      at org.eclipse.swt.widgets.Display.applicationProc(Display.java:4659)
      at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
      at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:115)
      at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3274)
      at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
      at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
      at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
      at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
      at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
      at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
      at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
      at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
      at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
      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:369)
      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:619)
      at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
      at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
      
      

        Activity

        Hide
        Andrew Eisenberg added a comment -

        Added null check to avoid the problem in this location as well as another.

        Will be available in next snapshot.

        Show
        Andrew Eisenberg added a comment - Added null check to avoid the problem in this location as well as another. Will be available in next snapshot.

          People

          • Assignee:
            Andrew Eisenberg
            Reporter:
            Graeme Rocher
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: