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

SetRenderingHints uses wrong equality test

XMLWordPrintable

    • 2d
    • sparc
    • solaris_2.6



      Name: diC59631 Date: 10/01/98


      I am give the user a preferences dialog to allow
      changing their default rendering hints and I keep
      these in a preferences/properties file.

      When I read these properties back in again, I can't
      pass them to SetRenderingHint because I get an
      IllegalArgumentException thrown.

      I fired up javap and worked out that sun.awt.Graphics2D
      (I think that's right) checks for equality
      of rendering hints using == instead of .equals().
      I have to put code in my app like:

           if (hint.equals(RenderingHint.ANTIALIASING))
               hint = RenderingHint.ANTIALIASING;

      after reading in my preferences file. This is tedious,
      (there are dozens of strings to worry about) but works.

      My request is for Java2D to use .equals() rather than ==
      when comparing rendering hints. I don't believe this
      would affect performance; it shouldn't break anything
      and would allow serialization of rendering hints.
      (Review ID: 39748)
      ======================================================================

            flar Jim Graham
            dindrigo Daniel Indrigo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: