Bug 58778 AFE in JavaHeuristicScanner.findOpeningPeer(..)
Copy & Paste these two lines into the condition field of a breakpoint properties dialog: control= getCellEditors()[0].getControl(); return false; -> Log: Error Apr 16, 2004 03:05:51.373 Assertion failed: org.eclipse.jface.text.Assert$AssertionFailedException: Assertion failed: at java.lang.Throwable.<init>(Throwable.java) at java.lang.Throwable.<init>(Throwable.java) at org.eclipse.jface.text.Assert$AssertionFailedException.<init>(Assert.java:54) at org.eclipse.jface.text.Assert.isTrue(Assert.java:175) at org.eclipse.jface.text.Assert.isTrue(Assert.java) at org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.findOpeningPeer(JavaHeuristicScanner.java:542) at org.eclipse.jdt.internal.ui.text.java.JavaAutoIndentStrategy.getPeerPosition(JavaAutoIndentStrategy.java:892) at org.eclipse.jdt.internal.ui.text.java.JavaAutoIndentStrategy.smartPaste(JavaAutoIndentStrategy.java:601) at org.eclipse.jdt.internal.ui.text.java.JavaAutoIndentStrategy.customizeDocumentCommand(JavaAutoIndentStrategy.java:1000) at org.eclipse.jface.text.TextViewer.customizeDocumentCommand(TextViewer.java) at org.eclipse.jface.text.TextViewer.handleVerifyEvent(TextViewer.java) at org.eclipse.jface.text.TextViewer$TextVerifyListener.verifyText(TextViewer.java:325) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java) at org.eclipse.swt.custom.StyledText.modifyContent(StyledText.java:5539) at org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:6389) at org.eclipse.swt.custom.StyledText.paste(StyledText.java:5586) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java) at java.lang.reflect.Method.invoke(Method.java) at org.eclipse.ui.handlers.WidgetMethodHandler.execute(WidgetMethodHandler.java:81) at org.eclipse.ui.handlers.HandlerProxy.execute(HandlerProxy.java:111) at org.eclipse.ui.internal.commands.Command.execute(Command.java:172) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:465) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$2(WorkbenchKeyboard.java) at org.eclipse.ui.internal.keys.WorkbenchKeyboard$1.handleEvent(WorkbenchKeyboard.java) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java) at org.eclipse.swt.widgets.Display.filterEvent(Display.java) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java) at org.eclipse.swt.widgets.Control.sendKeyEvent(Control.java) at org.eclipse.swt.widgets.Control.sendKeyEvent(Control.java) at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java) at org.eclipse.swt.widgets.Control.windowProc(Control.java) at org.eclipse.swt.widgets.Display.windowProc(Display.java) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java) at org.eclipse.jface.window.Window.runEventLoop(Window.java) at org.eclipse.jface.window.Window.open(Window.java:650) at org.eclipse.ui.dialogs.PropertyDialogAction.run(PropertyDialogAction.java:164) at org.eclipse.jdt.internal.debug.ui.actions.JavaBreakpointPropertiesRulerAction.run(JavaBreakpointPropertiesRulerAction.java:56) at org.eclipse.ui.texteditor.AbstractRulerActionDelegate.run(AbstractRulerActionDelegate.java:98) at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:269) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:550) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1561) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1532) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:257) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:140) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:90) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:279) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:241) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:117) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:41) at java.lang.reflect.Method.invoke(Method.java:386) at org.eclipse.core.launcher.Main.basicRun(Main.java:267) at org.eclipse.core.launcher.Main.run(Main.java:692) at org.eclipse.core.launcher.Main.main(Main.java:676)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaAutoIndentStrategy.java
int to= from;
		while (toDelete > 0 && to < endOffset) {
			char ch= document.getChar(to);
			if (!Character.isWhitespace(ch))
				break;
			toDelete -= computeVisualLength(ch);
			if (toDelete >= 0)
				to++;
			else
				break;
		}
		
		document.replace(from, to - from, null);
	}
	/**
	 * Returns the visual length of a given <code>CharSequence</code> taking into
	 * account the visual tabulator length.
	 * 
	 * @param seq the string to measure
	 * @return the visual length of <code>seq</code>
	 */
	private static int computeVisualLength(CharSequence seq) {
		int size= 0;
		int tablen= getVisualTabLengthPreference();
		
		for (int i= 0; i < seq.length(); i++) {
			char ch= seq.charAt(i);
			if (ch == '\t')
				size += tablen - size % tablen;