-
Bug
-
Resolution: Fixed
-
P4
-
1.4.2
-
b56
-
x86
-
windows_2000
Name: rmT116609 Date: 07/17/2003
A DESCRIPTION OF THE PROBLEM :
The API documentation for FontMetrics.getStringBounds(char[] chars,int beginIndex,int limit,Graphics
context)
says:
Parameters:
chars - an array of characters
beginIndex - the initial offset of the array of characters
limit - the length of the array of characters
context - the specified Graphics context
However, the limit parameter is really an endIndex, not a length. That is,
Sun's code is going to make a loop like:
for (i = beginIndex; i < limit; i++)
This applies to a couple other variants of getStringBounds() as well.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The description of the limit parameter should say:
limit - the ending offset into the array of characters, exclusive
ACTUAL -
limit - the length of the array of characters
URL OF FAULTY DOCUMENTATION :
http://java.sun.com/j2se/1.4.2/docs/api/java/awt/FontMetrics.html
(Incident Review ID: 191848)
======================================================================
A DESCRIPTION OF THE PROBLEM :
The API documentation for FontMetrics.getStringBounds(char[] chars,int beginIndex,int limit,Graphics
context)
says:
Parameters:
chars - an array of characters
beginIndex - the initial offset of the array of characters
limit - the length of the array of characters
context - the specified Graphics context
However, the limit parameter is really an endIndex, not a length. That is,
Sun's code is going to make a loop like:
for (i = beginIndex; i < limit; i++)
This applies to a couple other variants of getStringBounds() as well.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The description of the limit parameter should say:
limit - the ending offset into the array of characters, exclusive
ACTUAL -
limit - the length of the array of characters
URL OF FAULTY DOCUMENTATION :
http://java.sun.com/j2se/1.4.2/docs/api/java/awt/FontMetrics.html
(Incident Review ID: 191848)
======================================================================