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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8u20
    • 8
    • javafx
    • None

      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;
           }

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

              Created:
              Updated:
              Resolved:
              Imported: