Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 400693 - [implementation] StringIndexOutOfBoundsException in DefaultInformationControl.setInformation()
Summary: [implementation] StringIndexOutOfBoundsException in DefaultInformationControl...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.8   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.3 M6   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 208018 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-02-13 10:14 EST by Rüdiger Herrmann CLA
Modified: 2013-02-14 07:17 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rüdiger Herrmann CLA 2013-02-13 10:14:59 EST
This snippet leads to a StringIndexOutOfBoundsException
    DefaultInformationControl informationControl = new DefaultInformationControl( shell, false );
    informationControl.setInformation( "foo" );
    
Though I am not sure if I use the API correctly, an exception shouldn't be the answer.

Stacktrace:
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
	at java.lang.String.substring(String.java:1937)
	at org.eclipse.jface.internal.text.link.contentassist.LineBreakingReader.findNextBreakOffset(LineBreakingReader.java:111)
	at org.eclipse.jface.internal.text.link.contentassist.LineBreakingReader.readLine(LineBreakingReader.java:78)
	at org.eclipse.jface.internal.text.html.HTMLTextPresenter.updatePresentation(HTMLTextPresenter.java:132)
	at org.eclipse.jface.text.DefaultInformationControl.setInformation(DefaultInformationControl.java:336)
Comment 2 Dani Megert CLA 2013-02-14 07:12:31 EST
*** Bug 208018 has been marked as a duplicate of this bug. ***
Comment 3 Dani Megert CLA 2013-02-14 07:17:12 EST
.