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

[Font] FontWeight#getWeight() totally broken (value not saved in constructor)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 8u20
    • Component/s: javafx
    • Labels:
      None

      Description

      FontWeight#getWeight() totally broken
      Try
              System.out.println(FontWeight.THIN.getWeight());
              System.out.println(FontWeight.BOLD.getWeight());
              System.out.println(FontWeight.EXTRA_BOLD.getWeight());
              System.out.println(FontWeight.SEMI_BOLD.getWeight());

      all print zero

      The one line fix:
      felipe-mac:rt felipe$ hg diff modules/graphics/src/main/java/javafx/scene/text/FontWeight.java -w
      diff -r 5feecc88645d modules/graphics/src/main/java/javafx/scene/text/FontWeight.java
      --- a/modules/graphics/src/main/java/javafx/scene/text/FontWeight.java Fri Dec 13 16:37:19 2013 -0800
      +++ b/modules/graphics/src/main/java/javafx/scene/text/FontWeight.java Mon Dec 16 12:33:55 2013 -0800
      @@ -85,6 +85,7 @@
           private final String[] names;
           
           private FontWeight(int weight, String... names) {
      + this.weight = weight;
               this.names = names;
           }

        Attachments

          Activity

            People

            Assignee:
            fheidric Felipe Heidrich (Inactive)
            Reporter:
            fheidric Felipe Heidrich (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported: