8022080: javadoc generates invalid HTML in Turkish locale
authorjjg
Tue, 20 Aug 2013 14:55:20 -0700
changeset 19511 59a48a75fac7
parent 19510 d2afcb89b0e7
child 19512 07dcf1232608
8022080: javadoc generates invalid HTML in Turkish locale Reviewed-by: bpatel
langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java
langtools/src/share/classes/com/sun/tools/doclint/HtmlTag.java
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java	Tue Aug 20 14:46:54 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java	Tue Aug 20 14:55:20 2013 -0700
@@ -25,6 +25,8 @@
 
 package com.sun.tools.doclets.formats.html.markup;
 
+import java.util.Locale;
+
 /**
  * Enum representing HTML tags.
  *
@@ -115,7 +117,7 @@
     HtmlTag(BlockType blockType, EndTag endTag ) {
         this.blockType = blockType;
         this.endTag = endTag;
-        this.value = name().toLowerCase();
+        this.value = name().toLowerCase(Locale.US);
     }
 
     /**
--- a/langtools/src/share/classes/com/sun/tools/doclint/HtmlTag.java	Tue Aug 20 14:46:54 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclint/HtmlTag.java	Tue Aug 20 14:55:20 2013 -0700
@@ -30,6 +30,7 @@
 import java.util.EnumMap;
 import java.util.EnumSet;
 import java.util.HashMap;
+import java.util.Locale;
 import java.util.Map;
 
 import javax.lang.model.element.Name;
@@ -345,7 +346,7 @@
         WIDTH;
 
         public String getText() {
-            return name().toLowerCase();
+            return toLowerCase(name());
         }
 
         static final Map<String,Attr> index = new HashMap<String,Attr>();
@@ -424,11 +425,11 @@
     }
 
     public String getText() {
-        return name().toLowerCase();
+        return toLowerCase(name());
     }
 
     public Attr getAttr(Name attrName) {
-        return Attr.index.get(attrName.toString().toLowerCase());
+        return Attr.index.get(toLowerCase(attrName.toString()));
     }
 
     public AttrKind getAttrKind(Name attrName) {
@@ -450,6 +451,10 @@
     }
 
     static HtmlTag get(Name tagName) {
-        return index.get(tagName.toString().toLowerCase());
+        return index.get(toLowerCase(tagName.toString()));
+    }
+
+    private static String toLowerCase(String s) {
+        return s.toLowerCase(Locale.US);
     }
 }