Bug 32273 StringIndexOutOfBoundsException in JUnit plugin [JUnit]
Using 0218 and Pde/Junit1.2.4, I got the following exception. java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(String.java:1480) at org.eclipse.jdt.internal.junit.ui.FailureRunView.getClassName(FailureRunView.java:105) at org.eclipse.jdt.internal.junit.ui.FailureRunView.handleDoubleClick(FailureRunView.java:243) at org.eclipse.jdt.internal.junit.ui.FailureRunView$3.mouseDoubleClick(FailureRunView.java:205) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:134) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:836) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1692) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1410) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1288) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1271) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:845) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461) 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:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:247) at org.eclipse.core.launcher.Main.run(Main.java:703) at org.eclipse.core.launcher.Main.main(Main.java:539) I have no steps to reproduce so far, but I think it's worth logging a PR.
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/FailureRunView.java
fFailureTabIcon.dispose();
	}
	private void initMenu() {
		MenuManager menuMgr= new MenuManager();
		menuMgr.setRemoveAllWhenShown(true);
		menuMgr.addMenuListener(this);
		Menu menu= menuMgr.createContextMenu(fTable);
		fTable.setMenu(menu);
	}
	
	public String getName() {
		return JUnitMessages.getString("FailureRunView.tab.title"); 
	}
	
	public String getTestName() {
		int index= fTable.getSelectionIndex();
		if (index == -1)
			return null;
		return fTable.getItem(index).getText();
	}
	
	private String getClassName() {
		String className= getSelectedText();
		className= className.substring(className.indexOf('(') + 1);
		return className.substring(0, className.indexOf(')'));
	}
	
	private String getMethodName() {
		String methodName= getSelectedText();
		return methodName.substring(0, methodName.indexOf('('));