Project: aptanastudio
Issue APSTUD-4501: BadLocationException in the log after hitting Enter in a ruby file
After creating an empty ruby file and hitting Enter in the editor, the following exception is generated in the log: {code} !ENTRY com.aptana.editor.ruby 4 0 2012-03-14 17:48:18.084 !MESSAGE (Build 3.0.3.1331216954) [ERROR] Unable to get text of line at offset: -1 !STACK 0 org.eclipse.jface.text.BadLocationException org.eclipse.jface.text.TreeLineTracker.fail(TreeLineTracker.java:1055) org.eclipse.jface.text.TreeLineTracker.lineByOffset(TreeLineTracker.java:267) org.eclipse.jface.text.TreeLineTracker.getLineNumberOfOffset(TreeLineTracker.java:1137) org.eclipse.jface.text.AbstractLineTracker.getLineNumberOfOffset(AbstractLineTracker.java:161) org.eclipse.jface.text.AbstractDocument.getLineOfOffset(AbstractDocument.java:915) org.eclipse.core.internal.filebuffers.SynchronizableDocument.getLineOfOffset(SynchronizableDocument.java:397) com.aptana.editor.ruby.RubyAutoIndentStrategy.autoIndent(RubyAutoIndentStrategy.java:65) com.aptana.editor.common.text.RubyRegexpAutoIndentStrategy.customizeDocumentCommand(RubyRegexpAutoIndentStrategy.java:50) org.eclipse.jface.text.TextViewer.customizeDocumentCommand(TextViewer.java:3745) org.eclipse.jface.text.TextViewer.handleVerifyEvent(TextViewer.java:3782) org.eclipse.jface.text.source.projection.ProjectionViewer.handleVerifyEvent(ProjectionViewer.java:1277) org.eclipse.jface.text.TextViewer$TextVerifyListener.verifyText(TextViewer.java:435) org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:265) org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) org.eclipse.swt.widgets.Display.sendEvent(Display.java:4128) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1465) org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1270) org.eclipse.swt.custom.StyledText.modifyContent(StyledText.java:7148) org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:7994) org.eclipse.swt.custom.StyledText.doContent(StyledText.java:2456) org.eclipse.swt.custom.StyledText.handleKey(StyledText.java:5911) org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5941) org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5635) org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) org.eclipse.swt.widgets.Display.sendEvent(Display.java:4128) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1465) org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1494) org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1490) org.eclipse.swt.widgets.Canvas.sendKeyEvent(Canvas.java:463) org.eclipse.swt.widgets.Control.doCommandBySelector(Control.java:1051) org.eclipse.swt.widgets.Display.windowProc(Display.java:5563) org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method) org.eclipse.swt.internal.cocoa.NSResponder.interpretKeyEvents(NSResponder.java:68) org.eclipse.swt.widgets.Composite.keyDown(Composite.java:587) org.eclipse.swt.widgets.Display.windowProc(Display.java:5473) org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) org.eclipse.swt.widgets.Widget.callSuper(Widget.java:220) org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:2092) org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2252) org.eclipse.swt.widgets.Display.windowProc(Display.java:5535) org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:4989) org.eclipse.swt.widgets.Display.applicationProc(Display.java:5138) org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method) org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:128) org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3610) org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696) org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660) org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494) org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674) org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667) org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) com.appcelerator.titanium.rcp.IDEApplication.start(IDEApplication.java:125) org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344) org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) org.eclipse.equinox.launcher.Main.run(Main.java:1410) {code}
Story points: 3