Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 317946 - [StyledText]java.lang.IllegalArgumentException: Index out of bounds happen when StyledText setText("")
Summary: [StyledText]java.lang.IllegalArgumentException: Index out of bounds happen wh...
Status: CLOSED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.0   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-25 06:28 EDT by Sun Yuechen CLA
Modified: 2017-07-06 08:36 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sun Yuechen CLA 2010-06-25 06:28:46 EDT
Build Identifier: org.eclipse.swt.win32.win32.x86_3.5.1.v3555a

When I invoke StyledText.setText(""), an Exception happens.
at org.eclipse.swt.SWT.error(SWT.java:3865)
[ 2010-06-07 11:41:21.187 11 ] 	at org.eclipse.swt.SWT.error(SWT.java:3799)
[ 2010-06-07 11:41:21.187 11 ] 	at org.eclipse.swt.SWT.error(SWT.java:3770)
[ 2010-06-07 11:41:21.187 11 ] 	at org.eclipse.swt.graphics.TextLayout.getStyle(TextLayout.java:2342)
[ 2010-06-07 11:41:21.187 11 ] 	at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:927)
[ 2010-06-07 11:41:21.187 11 ] 	at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:702)
[ 2010-06-07 11:41:21.187 11 ] 	at org.eclipse.swt.custom.StyledTextRenderer.calculate(StyledTextRenderer.java:202)
[ 2010-06-07 11:41:21.187 11 ] 	at org.eclipse.swt.custom.StyledTextRenderer.calculateClientArea(StyledTextRenderer.java:220)
[ 2010-06-07 11:41:21.187 11 ] 	at org.eclipse.swt.custom.StyledText.resetCache(StyledText.java:7245)
[ 2010-06-07 11:41:21.187 11 ] 	at org.eclipse.swt.custom.StyledText.reset(StyledText.java:7238)
[ 2010-06-07 11:41:21.187 11 ] 	at org.eclipse.swt.custom.StyledText.handleTextSet(StyledText.java:6157)
[ 2010-06-07 11:41:21.187 11 ] 	at org.eclipse.swt.custom.StyledText$6.textSet(StyledText.java:5524)
[ 2010-06-07 11:41:21.187 11 ] 	at org.eclipse.swt.custom.StyledTextListener.handleEvent(StyledTextListener.java:76)
[ 2010-06-07 11:41:21.187 11 ] 	at org.eclipse.swt.custom.DefaultContent.sendTextEvent(DefaultContent.java:795)
[ 2010-06-07 11:41:21.187 11 ] 	at org.eclipse.swt.custom.DefaultContent.setText(DefaultContent.java:814)
[ 2010-06-07 11:41:21.187 11 ] 	at org.eclipse.swt.custom.StyledText.setText(StyledText.java:9183)

Reproducible: Couldn't Reproduce
Comment 1 Felipe Heidrich CLA 2010-06-25 13:32:09 EDT
I need reproducible test case before I can work on this problem. Thank you.
Comment 2 Niraj Modi CLA 2017-07-06 08:36:09 EDT
Tried StyledText#setText("") with below snippet:
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet244.java

Cannot reproduce this problem, hence closing as 'WORKS_FOR_ME'
You can reopen this bug if it still happens with any of the current supported platforms with valid steps to reproduce this issue.