## modules/graphics/src/main/java/javafx/scene/CssStyleHelper.java

Print this page

    rev 4839 : RT-2529: Locale specific runtime errors (Turkish)

    @@ -27,10 +27,11 @@
     import java.util.ArrayList;
     import java.util.Collections;
     import java.util.HashMap;
     import java.util.HashSet;
     import java.util.List;
    +import java.util.Locale;
     import java.util.Map;
     import java.util.Map.Entry;
     import java.util.Set;

     import com.sun.javafx.scene.CssFlags;

    @@ -1505,11 +1506,11 @@
         }

         /*package access for testing*/ FontPosture getFontPosture(Font font) {
             if (font == null) return FontPosture.REGULAR;

    -        String fontName = font.getName().toLowerCase();
    +        String fontName = font.getName().toLowerCase(Locale.ROOT);

             if (fontName.contains("italic")) {
                 return FontPosture.ITALIC;
             }

    @@ -1517,11 +1518,11 @@
         }

         /*package access for testing*/ FontWeight getFontWeight(Font font) {
             if (font == null) return FontWeight.NORMAL;

    -        String fontName = font.getName().toLowerCase();
    +        String fontName = font.getName().toLowerCase(Locale.ROOT);

             if (fontName.contains("bold")) {
                 if (fontName.contains("extra")) return FontWeight.EXTRA_BOLD;
                 if (fontName.contains("ultra")) return FontWeight.EXTRA_BOLD;
                 else if (fontName.contains("semi")) return FontWeight.SEMI_BOLD;