Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 215011 - StringIndexOutOfBoundsException in ConsoleDocumentAdapter
Summary: StringIndexOutOfBoundsException in ConsoleDocumentAdapter
Status: RESOLVED DUPLICATE of bug 207743
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.3.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-11 07:48 EST by Jonas Flodén CLA
Modified: 2008-01-11 09:05 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonas Flodén CLA 2008-01-11 07:48:39 EST
Build ID: M20071023-1652

Steps To Reproduce:
I get a problem in
org.eclipse.ui.internal.console.ConsoleDocumentAdapter.java
at line 323
When string is just a carriage return "\r" offset will be lowered to -1 which will cause a StringIndexOutOfBoundsException on the next iteration.

int offset = string.length() - 1;
while (string.charAt(offset) == '\r') {
    offset--;
    count++;
}


More information:
This is probably related to bug 84641
I get the same error when I run the code example there:
public class CarriageReturn {
    public static void main(String[] args) {
        System.out.print("\r");
    }
}
Comment 1 Darin Wright CLA 2008-01-11 09:05:00 EST
Fixed in 3.3.2

*** This bug has been marked as a duplicate of bug 207743 ***