RefactoringFactory.collectRefactorings() seems to call SGLRParseController.getEditor(). The editor is only assigned to it after the editor has parsed for the first time, so it shouldn’t be accessed on service initialization time. In my case, it returned null, breaking the refactoring service.


Could not load refactorings
org.strategoxt.imp.runtime.dynamicloading.BadDescriptorException: Exception occurred when initializing IRefactoringMap editor service for Stratego-Sugar
at org.strategoxt.imp.runtime.dynamicloading.Descriptor.createService(Descriptor.java:200)
at org.strategoxt.imp.runtime.services.RefactoringContributionFactory.getRefactorings(RefactoringContributionFactory.java:40)
at org.strategoxt.imp.runtime.services.RefactoringContributionFactory.createContributionItems(RefactoringContributionFactory.java:26)
at org.eclipse.ui.internal.menus.ProxyMenuAdditionCacheEntry.createContributionItems(ProxyMenuAdditionCacheEntry.java:60)
at org.eclipse.ui.internal.menus.WorkbenchMenuService$5.run(WorkbenchMenuService.java:584)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.menus.WorkbenchMenuService.processAdditions(WorkbenchMenuService.java:656)
at org.eclipse.ui.internal.menus.WorkbenchMenuService.addContributionsToManager(WorkbenchMenuService.java:744)
at org.eclipse.ui.internal.menus.WorkbenchMenuService.populateContributionManager(WorkbenchMenuService.java:730)
at org.eclipse.ui.internal.menus.SlaveMenuService.populateContributionManager(SlaveMenuService.java:203)
at org.eclipse.ui.internal.menus.SlaveMenuService.populateContributionManager(SlaveMenuService.java:76)
at org.eclipse.ui.internal.PopupMenuExtender.addMenuContributions(PopupMenuExtender.java:357)
at org.eclipse.ui.internal.PopupMenuExtender.menuAboutToShow(PopupMenuExtender.java:335)
at org.eclipse.jface.action.MenuManager.fireAboutToShow(MenuManager.java:342)
at org.eclipse.jface.action.MenuManager.handleAboutToShow(MenuManager.java:473)
at org.eclipse.jface.action.MenuManager.access$1(MenuManager.java:469)
at org.eclipse.jface.action.MenuManager$2.menuShown(MenuManager.java:495)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:247)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4128)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1461)
at org.eclipse.swt.widgets.Menu.menuWillOpen(Menu.java:805)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:5525)
at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
at org.eclipse.swt.internal.cocoa.NSMenu.popUpContextMenu(NSMenu.java:73)
at org.eclipse.swt.widgets.Menu._setVisible(Menu.java:277)
at org.eclipse.swt.widgets.Display.runPopups(Display.java:4051)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3606)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
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:344)
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:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Caused by: java.lang.NullPointerException
at org.strategoxt.imp.runtime.dynamicloading.RefactoringFactory.getIdPattern(RefactoringFactory.java:256)
at org.strategoxt.imp.runtime.dynamicloading.RefactoringFactory.getInputFields(RefactoringFactory.java:233)
at org.strategoxt.imp.runtime.dynamicloading.RefactoringFactory.collectRefactorings(RefactoringFactory.java:126)
at org.strategoxt.imp.runtime.dynamicloading.RefactoringFactory.create(RefactoringFactory.java:50)
at org.strategoxt.imp.runtime.dynamicloading.RefactoringFactory.create(RefactoringFactory.java:1)
at org.strategoxt.imp.runtime.dynamicloading.Descriptor.createService(Descriptor.java:190)
… 50 more

Submitted by Lennart Kats on 8 February 2012 at 19:57

On 8 February 2012 at 19:57 Lennart Kats tagged @maartje

On 8 February 2012 at 19:57 Lennart Kats tagged refactoring

On 17 October 2012 at 10:52 Maartje commented:

fixed in r25578


On 17 October 2012 at 10:52 Maartje closed this issue.

On 17 October 2012 at 12:03 Maartje tagged 1.1

Log in to post comments