Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4236063

java.awt.font.GlyphVector.getGlyphPosition(int glyphIndex) has doc problem

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.3.0
    • 1.3.0
    • docs
    • 1.3
    • generic
    • generic
    • Verified

      java.awt.font.GlyphVector.getGlyphPosition(int glyphIndex) does not throw any exception when java.lang.Integer.MIN_VALUE is passed to the int argument glyphIndex. But as per the spec the method is supposed to throw IndexOutOfBoundsException.

      Sample Test
      -----------
      import java.awt.font.GlyphVector;
      import java.awt.geom.Point2D;
      import java.awt.Font;
      import java.awt.font.FontRenderContext;
      import java.awt.geom.AffineTransform;

      public class Test{

      public static void main(String[] arg){

        Font font = new Font("Courier",Font.ITALIC,20);
        FontRenderContext fontRC=new FontRenderContext(
      new AffineTransform(),true,true);
        GlyphVector gv = font.createGlyphVector(fontRC,"Hello") ;
        Point2D gj=gv.getGlyphPosition(Integer.MIN_VALUE);
        System.out.println(gj.getX()+","+gj.getY());
       }
      }

            dougfelt Doug Felt (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: