Bug 10970 Index out of bounds exception when deleting code
Build 20020305 with latest stuff from 20020307 (catchup) - created a new file using the create CU wizard - selected the copyright using the shift down key combination - deleted it - selected the class comment using the shift down combination - deleted it Got the following exception: java.lang.IllegalArgumentException: Index out of bounds Stack trace: java/lang/Throwable.<init>()V java/lang/Throwable.<init>(Ljava/lang/String;)V org/eclipse/swt/SWT.error(ILjava/lang/Throwable;)V org/eclipse/swt/SWT.error(I)V org/eclipse/swt/custom/StyledText.redrawRange(IIZ)V org/eclipse/jdt/internal/ui/javaeditor/LinePainter.drawHighlightLine()V org/eclipse/jdt/internal/ui/javaeditor/LinePainter.paint()V org/eclipse/jdt/internal/ui/javaeditor/PaintManager.paint()V org/eclipse/jdt/internal/ui/javaeditor/PaintManager.selectionChanged (Lorg/eclipse/jface/viewers/SelectionChangedEvent;)V org/eclipse/jface/viewers/Viewer.fireSelectionChanged (Lorg/eclipse/jface/viewers/SelectionChangedEvent;)V org/eclipse/jface/text/TextViewer.selectionChanged(II)V org/eclipse/jface/text/TextViewer$4.widgetSelected (Lorg/eclipse/swt/events/SelectionEvent;)V org/eclipse/swt/widgets/TypedListener.handleEvent (Lorg/eclipse/swt/widgets/Event;)V org/eclipse/swt/widgets/EventTable.sendEvent(Lorg/eclipse/swt/widgets/Event;) V org/eclipse/swt/widgets/Widget.notifyListeners (ILorg/eclipse/swt/widgets/Event;)V org/eclipse/swt/custom/StyledText.sendSelectionEvent()V org/eclipse/swt/custom/StyledText.clearSelection(Z)V org/eclipse/swt/custom/StyledText.internalSetSelection(IIZ)V org/eclipse/swt/custom/StyledText.updateSelection(III)V org/eclipse/swt/custom/StyledText.handleTextChanged (Lorg/eclipse/swt/custom/TextChangedEvent;)V org/eclipse/swt/custom/StyledText$6.textChanged (Lorg/eclipse/swt/custom/TextChangedEvent;)V org/eclipse/jface/text/DocumentAdapter.fireTextChanged()V org/eclipse/jface/text/DocumentAdapter.documentChanged (Lorg/eclipse/jface/text/DocumentEvent;)V org/eclipse/jface/text/AbstractDocument.fireDocumentChanged (Lorg/eclipse/jface/text/DocumentEvent;)V org/eclipse/jface/text/AbstractDocument.replace(IILjava/lang/String;)V org/eclipse/jface/text/DocumentAdapter.replaceTextRange(IILjava/lang/String;) V org/eclipse/swt/custom/StyledText.modifyContent (Lorg/eclipse/swt/widgets/Event;Z)V org/eclipse/swt/custom/StyledText.sendKeyEvent (Lorg/eclipse/swt/widgets/Event;)V org/eclipse/swt/custom/StyledText.doDelete()V org/eclipse/swt/custom/StyledText.invokeAction(I)V org/eclipse/swt/custom/StyledText.handleKey(Lorg/eclipse/swt/widgets/Event;)V org/eclipse/swt/custom/StyledText.handleKeyDown (Lorg/eclipse/swt/widgets/Event;)V org/eclipse/swt/custom/StyledText$8.handleEvent (Lorg/eclipse/swt/widgets/Event;)V org/eclipse/swt/widgets/EventTable.sendEvent(Lorg/eclipse/swt/widgets/Event;) V org/eclipse/swt/widgets/Widget.notifyListeners (ILorg/eclipse/swt/widgets/Event;)V org/eclipse/swt/widgets/Display.runDeferredEvents()Z org/eclipse/swt/widgets/Display.readAndDispatch()Z org/eclipse/ui/internal/Workbench.runEventLoop()V org/eclipse/ui/internal/Workbench.run(Ljava/lang/Object;)Ljava/lang/Object; org/eclipse/core/internal/boot/InternalBootLoader.run (Ljava/lang/String;Ljava/net/URL;Ljava/lang/String;[Ljava/lang/String;) Ljava/lang/Object; org/eclipse/core/boot/BootLoader.run (Ljava/lang/String;Ljava/net/URL;Ljava/lang/String;[Ljava/lang/String;) Ljava/lang/Object; SlimLauncher.main([Ljava/lang/String;)V
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/LinePainter.java
package org.eclipse.jdt.internal.ui.javaeditor;
/*
 * (c) Copyright IBM Corp. 2000, 2001.
 * All Rights Reserved.
 */
import org.eclipse.swt.custom.LineBackgroundEvent;
import org.eclipse.swt.custom.LineBackgroundListener;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.custom.StyledTextContent;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jdt.core.dom.CatchClause;
import org.eclipse.jdt.ui.text.JavaTextTools;
import org.eclipse.jdt.internal.ui.JavaPlugin;
public class LinePainter implements IPainter, LineBackgroundListener {
	
	private StyledText fTextWidget;
	private Color fHighlightColor;
	private int fLineNumber;
	private int[] fLine= { -1, -1 };
	private boolean fIsActive= false;
	
	
	public LinePainter(ISourceViewer sourceViewer) {
		fTextWidget= sourceViewer.getTextWidget();