changeset 1963:79e341614c50

8022080: javadoc generates invalid HTML in Turkish locale Reviewed-by: bpatel
author jjg
date Tue, 20 Aug 2013 14:55:20 -0700
parents a76dc1b4c299
children 720992953d43
files src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java src/share/classes/com/sun/tools/doclint/HtmlTag.java
diffstat 2 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java	Tue Aug 20 14:46:54 2013 -0700
+++ b/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/src/share/classes/com/sun/tools/doclint/HtmlTag.java	Tue Aug 20 14:46:54 2013 -0700
+++ b/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);
     }
 }