Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 5064835
Votes 0
Synopsis TextMeasurer/deleteChar function fails when deleting more than one characters.
Category java:classes_2d
Reported Against 1.3 , b24 , tiger-rc
Release Fixed
State 6-Fix Understood, bug
Priority: 3-Medium
Related Bugs 5064838 , 5064843 , 6234864
Submit Date 17-JUN-2004
Description
tested java version:
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta3-b56)

TextMeasurer deleteChar function will get exception if you try to delete more than one characters. 

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
        at java.lang.System.arraycopy(Native Method)
        at java.awt.font.TextMeasurer.deleteChar(TextMeasurer.java:721)
        at TextMeasureDeleteTest.main(TextMeasureDeleteTest.java:31)

It seems that source array index was set wrong if the deleted characters > 1.

See attached test case.
Work Around
N/A
Evaluation
I don't think this test can ever have passed, since its buggy. It fails
on 1.3.X too.

The test calls deleteChar which is used to replace the current paragraph
with a new one with a single character deleted.
To quote the javadoc
"Updates the TextMeasurer after a single character has been deleted .."
                                  ^^^^^^^
But the new text has two characters deleted and so is testing something
that's not supposed to work.

The only very minor problem I see here is that the docs whilst documenting
that this method can throw IOBE, don't explain it very well.
I'll let the engineer who owns this class decide how to handle it.

  xxxxx@xxxxx   2004-06-17
============================

Contribution forum : https://jdk-collaboration.dev.java.net/servlets/ProjectForumMessageView?forumID=1463&messageID=13413
Posted Date : 2006-06-08 06:02:44.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang