Bug 5599 - StyledText - redrawRange does not check range
Summary: StyledText - redrawRange does not check range
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows NT
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Knut Radloff CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-11-06 18:22 EST by Knut Radloff CLA
Modified: 2001-11-15 17:42 EST (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 Knut Radloff CLA 2001-11-06 18:22:27 EST
build 20011025

The redrawRange API does not check for invalid ranges specified by the 
arguments. All other StyledText API does check the range and throws an 
IllegalArgumentException when it is not valid.
When the default StyledTextContent is used the content does the range check and 
throws the exception. However, this is not spec'd at the StyledText level and 
other StyledTextContent won't throw the exception.
Changing this would be a breaking API change since clients may expect their own 
exceptions getting thrown at the content level.
Comment 1 Mike Wilson CLA 2001-11-07 08:37:04 EST
If the contract between StyledText and the StyledTextContent states that the
content should throw the exception, then you probably don't need to do 
anything. However, if you aren't requiring the content to do it, then you 
should handle it. Check with the known content providers to see what they do. 
If no one currently would be broken by the change, then you can just go ahead 
and make it. Make sure the javadoc is updated.
Comment 2 Lynne Kues CLA 2001-11-07 15:10:43 EST
Sent Kai email making sure this change won't affect him.  Waiting for response.
Comment 3 Lynne Kues CLA 2001-11-12 16:02:01 EST
Haven't heard anything from Kai against doing this.  Go ahead and put in the 
check.
Comment 4 Knut Radloff CLA 2001-11-15 17:42:34 EST
Fixed in the latest.
redrawRange now has the same range check as the other API (except for getText 
which has a different range check to be compatible with RichText).