Community
Participate
Working Groups
Created attachment 198319 [details] Clipboard contents I20110613-1736 Open from Clipboard throws a StringIndexOutOfBoundsException for an incomplete stacktrace. Steps: Copy the attached text to the clipboard and then invoke Open from Clipboard. => Exception in log: java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(String.java:1958) at org.eclipse.jdt.internal.debug.ui.actions.OpenFromClipboardAction.getJavaElementMatches(OpenFromClipboardAction.java:311) at org.eclipse.jdt.internal.debug.ui.actions.OpenFromClipboardAction.handleSingleLineInput(OpenFromClipboardAction.java:255) at org.eclipse.jdt.internal.debug.ui.actions.OpenFromClipboardAction.run(OpenFromClipboardAction.java:187) at org.eclipse.ui.internal.handlers.ActionDelegateHandlerProxy.execute(ActionDelegateHandlerProxy.java:289) 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:1262) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1104) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1100) at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1509) at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4640) at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:345) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4528) at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4972) at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:2424) at org.eclipse.swt.internal.BidiUtil.windowProc(BidiUtil.java:639) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2530) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752) 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:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) 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)
Just to make this clear: I copied this from a JUnit test result page, but the trace was already badly formatted there (no line breaks). I don't expect a nicely formatted trace in the Console view. The problem is only the exception.
Simpler test case: 1. Copy the following line: createContainer(ZipLeveledStructureProvider.java:78) 2. Navigate > Open from Clipboard
Created attachment 201697 [details] fix+test Problems mentioned in comment 0 and comment 2 are slightly different. With the patch "createContainer(ZipLeveledStructureProvider.java:78)" is handled nicely. (In reply to comment #1) > Just to make this clear: I copied this from a JUnit test result page, but the > trace was already badly formatted there (no line breaks). I don't expect a > nicely formatted trace in the Console view. The problem is only the exception. The patch avoids an exception but you still get an input edit dialog because there are no line breaks. I tried to copy a stacktrace from a JUnit test result page and it had proper line breaks, I wonder how you ended up in this situation. In any case handling (absence of) line breaks more gracefully is bug 327443.
Comment on attachment 201697 [details] fix+test The patch breaks the following: ZipLeveledStructureProvider.java:78 (ZipLeveledStructureProvider.java:78) No longer opens the editor on line 78.
Comment on attachment 201697 [details] fix+test > The patch breaks the following: > > ZipLeveledStructureProvider.java:78 > (ZipLeveledStructureProvider.java:78) > > No longer opens the editor on line 78. Sorry Deepak, my bad: I forgot that this class is not part of the JRE and hence it couldn't find it in my test workspace. Reviewed the patch and the tests.
Fixed in R3_7_maintenance. Available in builds >= M20110824-2000. Fixed in HEAD. Available in builds >= N20110818-2000.
The fix for this bug was not tagged and released for 3.7.1. The last change to the map file was on Aug 17th before this change was backported (and the last time the jdt debug entries were changed was Aug 3rd). This can be confirmed by downloading 3.7.1 and trying the original steps.
Mike, don't you do the weekly build input? What happened here?
(In reply to comment #8) > Mike, don't you do the weekly build input? What happened here? I do, and to be honest I have no idea what happened. Remarking as fixed, it got (re?)tagged into 3.7.2 with the build input I did yesterday
Verified in M20111128-1153.