Skip to content

Commit f829560

Browse files
8022080: javadoc generates invalid HTML in Turkish locale
Reviewed-by: bpatel
1 parent de59aa8 commit f829560

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525

2626
package com.sun.tools.doclets.formats.html.markup;
2727

28+
import java.util.Locale;
29+
2830
/**
2931
* Enum representing HTML tags.
3032
*
@@ -115,7 +117,7 @@ public static enum EndTag {
115117
HtmlTag(BlockType blockType, EndTag endTag ) {
116118
this.blockType = blockType;
117119
this.endTag = endTag;
118-
this.value = name().toLowerCase();
120+
this.value = name().toLowerCase(Locale.US);
119121
}
120122

121123
/**

langtools/src/share/classes/com/sun/tools/doclint/HtmlTag.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import java.util.EnumMap;
3131
import java.util.EnumSet;
3232
import java.util.HashMap;
33+
import java.util.Locale;
3334
import java.util.Map;
3435

3536
import javax.lang.model.element.Name;
@@ -345,7 +346,7 @@ public static enum Attr {
345346
WIDTH;
346347

347348
public String getText() {
348-
return name().toLowerCase();
349+
return toLowerCase(name());
349350
}
350351

351352
static final Map<String,Attr> index = new HashMap<String,Attr>();
@@ -424,11 +425,11 @@ public boolean acceptsText() {
424425
}
425426

426427
public String getText() {
427-
return name().toLowerCase();
428+
return toLowerCase(name());
428429
}
429430

430431
public Attr getAttr(Name attrName) {
431-
return Attr.index.get(attrName.toString().toLowerCase());
432+
return Attr.index.get(toLowerCase(attrName.toString()));
432433
}
433434

434435
public AttrKind getAttrKind(Name attrName) {
@@ -450,6 +451,10 @@ private static AttrMap attrs(AttrKind k, Attr... attrs) {
450451
}
451452

452453
static HtmlTag get(Name tagName) {
453-
return index.get(tagName.toString().toLowerCase());
454+
return index.get(toLowerCase(tagName.toString()));
455+
}
456+
457+
private static String toLowerCase(String s) {
458+
return s.toLowerCase(Locale.US);
454459
}
455460
}

0 commit comments

Comments
 (0)