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

Suspicious use of Boolean::getBoolean in WPathGraphics

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 8, 21, 24, 25
    • client-libs
    • None

      The static initializer of sun.awt.windows.WPathGraphics [1] reads the system property "sun.java2d.print.enableGDITextLayout", but then uses Boolean.getBoolean to interpret the value as true of false.

      This should probably use Boolean::parseBoolean instead [2][3], since otherwise Boolean::getBoolean will try to read a system property with a name already evaluated as the value of the "sun.java2d.print.enableGDITextLayout" property.

      [1] https://github.com/openjdk/jdk/blob/4f44cf6bf2423a57a841be817f348e3b1e88f0eb/src/java.desktop/windows/classes/sun/awt/windows/WPathGraphics.java#L97-L110
      [2] https://github.com/openjdk/jdk/pull/22083#discussion_r1876820904
      [3] https://github.com/openjdk/jdk/pull/22083#discussion_r1846889627

            eirbjo Eirik Bjørsnøs
            eirbjo Eirik Bjørsnøs
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: