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

toString of java.awt.geom.AffineTransform can show wrong values

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 21
    • client-libs
    • 2d

      The toString method of j.a.g.AffineTransform applies rounding (via _matround) to the individual matrix values before display ,which can cause an incorrect infinity value to show up for Double.MAX_VALUE:

      jshell> new java.awt.geom.AffineTransform(0,0,0,0,0,Double.MAX_VALUE);
      $1 ==> AffineTransform[[0.0, 0.0, 0.0], [0.0, 0.0, Infinity]]

      jshell> new java.awt.geom.AffineTransform(0,0,0,0,0,Double.POSITIVE_INFINITY);
      $2 ==> AffineTransform[[0.0, 0.0, 0.0], [0.0, 0.0, Infinity]]

      however,

      jshell> new java.awt.geom.AffineTransform(0,0,0,0,0,Float.MAX_VALUE);
      $5 ==> AffineTransform[[0.0, 0.0, 0.0], [0.0, 0.0, 3.4028234663852886E38]]


       



        

            prr Philip Race
            mschoene Marc Schönefeld
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: