提交 27202bd6 编写于 作者: J jjg

8022080: javadoc generates invalid HTML in Turkish locale

Reviewed-by: bpatel
上级 402f04ad
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
package com.sun.tools.doclets.formats.html.markup; package com.sun.tools.doclets.formats.html.markup;
import java.util.Locale;
/** /**
* Enum representing HTML tags. * Enum representing HTML tags.
* *
...@@ -115,7 +117,7 @@ public enum HtmlTag { ...@@ -115,7 +117,7 @@ public enum HtmlTag {
HtmlTag(BlockType blockType, EndTag endTag ) { HtmlTag(BlockType blockType, EndTag endTag ) {
this.blockType = blockType; this.blockType = blockType;
this.endTag = endTag; this.endTag = endTag;
this.value = name().toLowerCase(); this.value = name().toLowerCase(Locale.US);
} }
/** /**
......
...@@ -30,6 +30,7 @@ import java.util.Collections; ...@@ -30,6 +30,7 @@ import java.util.Collections;
import java.util.EnumMap; import java.util.EnumMap;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.HashMap; import java.util.HashMap;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import javax.lang.model.element.Name; import javax.lang.model.element.Name;
...@@ -345,7 +346,7 @@ public enum HtmlTag { ...@@ -345,7 +346,7 @@ public enum HtmlTag {
WIDTH; WIDTH;
public String getText() { public String getText() {
return name().toLowerCase(); return toLowerCase(name());
} }
static final Map<String,Attr> index = new HashMap<String,Attr>(); static final Map<String,Attr> index = new HashMap<String,Attr>();
...@@ -424,11 +425,11 @@ public enum HtmlTag { ...@@ -424,11 +425,11 @@ public enum HtmlTag {
} }
public String getText() { public String getText() {
return name().toLowerCase(); return toLowerCase(name());
} }
public Attr getAttr(Name attrName) { public Attr getAttr(Name attrName) {
return Attr.index.get(attrName.toString().toLowerCase()); return Attr.index.get(toLowerCase(attrName.toString()));
} }
public AttrKind getAttrKind(Name attrName) { public AttrKind getAttrKind(Name attrName) {
...@@ -450,6 +451,10 @@ public enum HtmlTag { ...@@ -450,6 +451,10 @@ public enum HtmlTag {
} }
static HtmlTag get(Name tagName) { 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);
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册