Exception when clicking transform
When clicking the transform button while the cursor is near the start of the file, I get the following exception in the error log and an error “Could not load builders” pops up twice. (I think this occurs when the cursor is in the top AST node, i.e. not in any subnode.)
org.strategoxt.imp.runtime.dynamicloading.BadDescriptorException: Exception occurred when initializing IBuilderMap editor service for Stratego-Sugar
at org.strategoxt.imp.runtime.dynamicloading.Descriptor.createService(Descriptor.java:201)
at org.strategoxt.imp.runtime.services.BuilderButtonDelegate.getBuilders(BuilderButtonDelegate.java:115)
at org.strategoxt.imp.runtime.services.BuilderButtonDelegate.run(BuilderButtonDelegate.java:65)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
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$6.handleEvent(ActionContributionItem.java:452)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3540)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3161)
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:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
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)
Caused by: java.lang.IndexOutOfBoundsException: No token at offset -1 (binary search returned -1)
at org.spoofax.jsglr.client.imploder.Tokenizer.getTokenAtOffset(Tokenizer.java:113)
at org.strategoxt.imp.runtime.parser.tokens.SGLRTokenIterator.getStartIndex(SGLRTokenIterator.java:42)
at org.strategoxt.imp.runtime.parser.tokens.SGLRTokenIterator.(SGLRTokenIterator.java:37)
at org.strategoxt.imp.runtime.parser.SGLRParseController.getTokenIterator(SGLRParseController.java:483)
at org.strategoxt.imp.runtime.EditorState.getSelectionAst(EditorState.java:206)
at org.strategoxt.imp.runtime.dynamicloading.BuilderFactory.addRefactorings(BuilderFactory.java:113)
at org.strategoxt.imp.runtime.dynamicloading.BuilderFactory.create(BuilderFactory.java:56)
at org.strategoxt.imp.runtime.dynamicloading.BuilderFactory.create(BuilderFactory.java:1)
at org.strategoxt.imp.runtime.dynamicloading.Descriptor.createService(Descriptor.java:191)
… 31 moreThis occurs in all editors I’ve tested, with quite recent nightly (not the very latest though.)
Submitted by Tobi Vollebregt on 21 April 2011 at 16:32
Issue Log
Seems like there’s two things causing this problem. The first is a simple off-by-one problem, the second seems to be a lack of null checks in
InputTermBuilder.getMatchingNode()
. I’m not really sure what to do about that one. Maartje, could you have a look at it?
I added a workaround for this in
r22883
, but it’s still not quite reliable. TheInputTermBuilder.getMatchingNode()
method is a bit of a mystery to me. Maartje if you have time to look at this at some point?
getMatchingNode fix (null check): getParent(ancestor) != null && getParent(ancestor).isList()
Log in to post comments