Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 339779

Summary: [Delete Line Action] throws java.lang.IllegalArgumentException: Index out of bounds
Product: [Modeling] TMF Reporter: Sven Efftinge <sven.efftinge>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: clay
Version: 2.0.0Flags: sven.efftinge: indigo+
Target Milestone: M7   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Sven Efftinge CLA 2011-03-11 21:29:44 EST
When hitting CTRL+D on the last line of a multiline comment (in purexbase)
the result is :


java.lang.IllegalArgumentException: Index out of bounds
	at org.eclipse.swt.SWT.error(SWT.java:3865)
	at org.eclipse.swt.SWT.error(SWT.java:3799)
	at org.eclipse.swt.SWT.error(SWT.java:3770)
	at org.eclipse.swt.custom.StyledText.setStyleRanges(StyledText.java:9016)
	at org.eclipse.swt.custom.StyledText.replaceStyleRanges(StyledText.java:7170)
	at org.eclipse.jface.text.TextViewer.addPresentation(TextViewer.java:4776)
	at org.eclipse.jface.text.TextViewer.changeTextPresentation(TextViewer.java:4855)
	at org.eclipse.jface.text.presentation.PresentationReconciler.applyTextRegionCollection(PresentationReconciler.java:579)
	at org.eclipse.jface.text.presentation.PresentationReconciler.processDamage(PresentationReconciler.java:568)
	at org.eclipse.jface.text.presentation.PresentationReconciler.access$3(PresentationReconciler.java:564)
	at org.eclipse.jface.text.presentation.PresentationReconciler$InternalListener.textChanged(PresentationReconciler.java:225)
	at org.eclipse.jface.text.TextViewer.updateTextListeners(TextViewer.java:2806)
	at org.eclipse.jface.text.TextViewer$VisibleDocumentListener.documentChanged(TextViewer.java:401)
	at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged2(AbstractDocument.java:739)
	at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:712)
	at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:697)
	at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.java:762)
	at org.eclipse.xtext.ui.editor.model.XtextDocument.fireDocumentChanged(XtextDocument.java:316)
	at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1157)
	at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1176)
	at org.eclipse.ui.texteditor.TextViewerDeleteLineTarget.deleteLine(TextViewerDeleteLineTarget.java:388)
	at org.eclipse.ui.texteditor.DeleteLineAction.run(DeleteLineAction.java:194)
Comment 1 Michael Clay CLA 2011-03-27 08:33:44 EDT
cannot reproduce the described behaviour with the following xbase snippet ..maybe you have an reproducible example/snippet for this bug?

/**
 * 
 *  BEFORE BLOCK
 * 
 */
try {
/**
 * 
 *  IN BLOCK
 * 
 */
	"".toString
} catch (Exception e) {
/**
 * 
 *  IN BLOCK
 * 
 */
 throw new Exception("IN BLOCK")
} finally {
/**
 * 
 *  IN BLOCK
 * 
 */
}
/**
 * 
 *  AFTER BLOCK
 * 
 */
 


(In reply to comment #0)
> When hitting CTRL+D on the last line of a multiline comment (in purexbase)
> the result is :
> 
> 
> java.lang.IllegalArgumentException: Index out of bounds
>     at org.eclipse.swt.SWT.error(SWT.java:3865)
>     at org.eclipse.swt.SWT.error(SWT.java:3799)
>     at org.eclipse.swt.SWT.error(SWT.java:3770)
>     at org.eclipse.swt.custom.StyledText.setStyleRanges(StyledText.java:9016)
>     at
> org.eclipse.swt.custom.StyledText.replaceStyleRanges(StyledText.java:7170)
>     at org.eclipse.jface.text.TextViewer.addPresentation(TextViewer.java:4776)
>     at
> org.eclipse.jface.text.TextViewer.changeTextPresentation(TextViewer.java:4855)
>     at
> org.eclipse.jface.text.presentation.PresentationReconciler.applyTextRegionCollection(PresentationReconciler.java:579)
>     at
> org.eclipse.jface.text.presentation.PresentationReconciler.processDamage(PresentationReconciler.java:568)
>     at
> org.eclipse.jface.text.presentation.PresentationReconciler.access$3(PresentationReconciler.java:564)
>     at
> org.eclipse.jface.text.presentation.PresentationReconciler$InternalListener.textChanged(PresentationReconciler.java:225)
>     at
> org.eclipse.jface.text.TextViewer.updateTextListeners(TextViewer.java:2806)
>     at
> org.eclipse.jface.text.TextViewer$VisibleDocumentListener.documentChanged(TextViewer.java:401)
>     at
> org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged2(AbstractDocument.java:739)
>     at
> org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:712)
>     at
> org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:697)
>     at
> org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.java:762)
>     at
> org.eclipse.xtext.ui.editor.model.XtextDocument.fireDocumentChanged(XtextDocument.java:316)
>     at
> org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1157)
>     at
> org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1176)
>     at
> org.eclipse.ui.texteditor.TextViewerDeleteLineTarget.deleteLine(TextViewerDeleteLineTarget.java:388)
>     at
> org.eclipse.ui.texteditor.DeleteLineAction.run(DeleteLineAction.java:194)
Comment 2 Sven Efftinge CLA 2011-03-28 03:01:10 EDT
Me neither. Seems to have been fixed in the meantime.