");
int end = lc.indexOf("
");
if(begin == -1 || end == -1 || end <= begin){
diff -r aec1999bb1fa -r f9f06fcca59d langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlAttr.java
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlAttr.java Tue Dec 17 10:55:58 2013 +0100
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlAttr.java Tue Dec 17 10:55:59 2013 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
package com.sun.tools.doclets.formats.html.markup;
+import com.sun.tools.javac.util.StringUtils;
+
/**
* Enum representing HTML tag attributes.
*
@@ -64,7 +66,7 @@
private final String value;
HtmlAttr() {
- this.value = name().toLowerCase();
+ this.value = StringUtils.toLowerCase(name());
}
HtmlAttr(String name) {
diff -r aec1999bb1fa -r f9f06fcca59d langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java Tue Dec 17 10:55:58 2013 +0100
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java Tue Dec 17 10:55:59 2013 +0100
@@ -25,7 +25,7 @@
package com.sun.tools.doclets.formats.html.markup;
-import java.util.Locale;
+import com.sun.tools.javac.util.StringUtils;
/**
* Enum representing HTML tags.
@@ -117,7 +117,7 @@
HtmlTag(BlockType blockType, EndTag endTag ) {
this.blockType = blockType;
this.endTag = endTag;
- this.value = name().toLowerCase(Locale.US);
+ this.value = StringUtils.toLowerCase(name());
}
/**
diff -r aec1999bb1fa -r f9f06fcca59d langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java Tue Dec 17 10:55:58 2013 +0100
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java Tue Dec 17 10:55:59 2013 +0100
@@ -29,6 +29,7 @@
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import javax.tools.JavaFileManager;
import com.sun.javadoc.*;
import com.sun.tools.javac.sym.Profiles;
@@ -36,7 +37,7 @@
import com.sun.tools.doclets.internal.toolkit.builders.BuilderFactory;
import com.sun.tools.doclets.internal.toolkit.taglets.*;
import com.sun.tools.doclets.internal.toolkit.util.*;
-import javax.tools.JavaFileManager;
+import com.sun.tools.javac.util.StringUtils;
/**
* Configure the output based on the options. Doclets should sub-class
@@ -337,7 +338,7 @@
* Negative value means error occurred.
*/
public int optionLength(String option) {
- option = option.toLowerCase();
+ option = StringUtils.toLowerCase(option);
if (option.equals("-author") ||
option.equals("-docfilessubdirs") ||
option.equals("-javafx") ||
@@ -454,7 +455,7 @@
// the output directory has already been created: so do that first.
for (int oi = 0; oi < options.length; ++oi) {
String[] os = options[oi];
- String opt = os[0].toLowerCase();
+ String opt = StringUtils.toLowerCase(os[0]);
if (opt.equals("-d")) {
destDirName = addTrailingFileSep(os[1]);
docFileDestDirName = destDirName;
@@ -465,7 +466,7 @@
for (int oi = 0; oi < options.length; ++oi) {
String[] os = options[oi];
- String opt = os[0].toLowerCase();
+ String opt = StringUtils.toLowerCase(os[0]);
if (opt.equals("-docfilessubdirs")) {
copydocfilesubdirs = true;
} else if (opt.equals("-docencoding")) {
@@ -708,7 +709,7 @@
String encoding = "";
for (int oi = 0; oi < options.length; oi++) {
String[] os = options[oi];
- String opt = os[0].toLowerCase();
+ String opt = StringUtils.toLowerCase(os[0]);
if (opt.equals("-docencoding")) {
docencodingfound = true;
if (!checkOutputFileEncoding(os[1], reporter)) {
diff -r aec1999bb1fa -r f9f06fcca59d langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java Tue Dec 17 10:55:58 2013 +0100
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java Tue Dec 17 10:55:59 2013 +0100
@@ -384,13 +384,13 @@
commentTextBuilder.append(
MessageFormat.format(
configuration.getText("doclet.PropertySetterWithName"),
- Util.propertyNameFromMethodName(member.name())));
+ Util.propertyNameFromMethodName(configuration, member.name())));
}
if (isGetter) {
commentTextBuilder.append(
MessageFormat.format(
configuration.getText("doclet.PropertyGetterWithName"),
- Util.propertyNameFromMethodName(member.name())));
+ Util.propertyNameFromMethodName(configuration, member.name())));
}
if (propertyDoc.commentText() != null
&& !propertyDoc.commentText().isEmpty()) {
diff -r aec1999bb1fa -r f9f06fcca59d langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java Tue Dec 17 10:55:58 2013 +0100
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java Tue Dec 17 10:55:59 2013 +0100
@@ -31,6 +31,7 @@
import com.sun.javadoc.*;
import com.sun.tools.doclets.internal.toolkit.*;
import com.sun.tools.doclets.internal.toolkit.util.*;
+import com.sun.tools.javac.util.StringUtils;
/**
* Builds the serialized form.
@@ -567,7 +568,7 @@
}
Tag[] serial = doc.tags("serial");
if (serial.length > 0) {
- String serialtext = serial[0].text().toLowerCase();
+ String serialtext = StringUtils.toLowerCase(serial[0].text());
if (serialtext.indexOf("exclude") >= 0) {
return false;
} else if (serialtext.indexOf("include") >= 0) {
diff -r aec1999bb1fa -r f9f06fcca59d langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/SimpleTaglet.java
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/SimpleTaglet.java Tue Dec 17 10:55:58 2013 +0100
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/SimpleTaglet.java Tue Dec 17 10:55:59 2013 +0100
@@ -28,6 +28,7 @@
import com.sun.javadoc.*;
import com.sun.tools.doclets.internal.toolkit.Content;
import com.sun.tools.doclets.internal.toolkit.util.DocFinder;
+import com.sun.tools.javac.util.StringUtils;
/**
* A simple single argument custom tag.
@@ -110,7 +111,7 @@
public SimpleTaglet(String tagName, String header, String locations) {
this.tagName = tagName;
this.header = header;
- locations = locations.toLowerCase();
+ locations = StringUtils.toLowerCase(locations);
if (locations.indexOf(ALL) != -1 && locations.indexOf(EXCLUDED) == -1) {
this.locations = PACKAGE + TYPE + FIELD + METHOD + CONSTRUCTOR + OVERVIEW;
} else {
diff -r aec1999bb1fa -r f9f06fcca59d langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java Tue Dec 17 10:55:58 2013 +0100
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java Tue Dec 17 10:55:59 2013 +0100
@@ -35,6 +35,7 @@
import com.sun.javadoc.*;
import com.sun.tools.doclets.internal.toolkit.util.*;
+import com.sun.tools.javac.util.StringUtils;
/**
* Manages theTaglet
s used by doclets.
@@ -304,7 +305,7 @@
return;
}
Taglet tag = customTags.get(tagName);
- locations = locations.toLowerCase();
+ locations = StringUtils.toLowerCase(locations);
if (tag == null || header != null) {
customTags.remove(tagName);
customTags.put(tagName, new SimpleTaglet(tagName, header, locations));
@@ -375,7 +376,7 @@
name = name.substring(1, name.length());
}
if (! (standardTags.contains(name) || customTags.containsKey(name))) {
- if (standardTagsLowercase.contains(name.toLowerCase())) {
+ if (standardTagsLowercase.contains(StringUtils.toLowerCase(name))) {
message.warning(tags[i].position(), "doclet.UnknownTagLowercase", tags[i].name());
continue;
} else {
@@ -708,7 +709,7 @@
private void initStandardTagsLowercase() {
IteratorThis is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
+ * This code and its internal interfaces are subject to change or
+ * deletion without notice.
+ */
+public class StringUtils {
+
+ /**Converts the given String to lower case using the {@link Locale#US US Locale}. The result
+ * is independent of the default Locale in the current JVM instance.
+ */
+ public static String toLowerCase(String source) {
+ return source.toLowerCase(Locale.US);
+ }
+
+ /**Converts the given String to upper case using the {@link Locale#US US Locale}. The result
+ * is independent of the default Locale in the current JVM instance.
+ */
+ public static String toUpperCase(String source) {
+ return source.toUpperCase(Locale.US);
+ }
+
+}
diff -r aec1999bb1fa -r f9f06fcca59d langtools/src/share/classes/com/sun/tools/javap/AttributeWriter.java
--- a/langtools/src/share/classes/com/sun/tools/javap/AttributeWriter.java Tue Dec 17 10:55:58 2013 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javap/AttributeWriter.java Tue Dec 17 10:55:59 2013 +0100
@@ -62,6 +62,7 @@
import com.sun.tools.classfile.Synthetic_attribute;
import static com.sun.tools.classfile.AccessFlags.*;
+import com.sun.tools.javac.util.StringUtils;
/*
* A writer for writing Attributes as text.
@@ -717,14 +718,14 @@
}
static String toHex(int i) {
- return Integer.toString(i, 16).toUpperCase();
+ return StringUtils.toUpperCase(Integer.toString(i, 16));
}
static String toHex(int i, int w) {
- String s = Integer.toHexString(i).toUpperCase();
+ String s = StringUtils.toUpperCase(Integer.toHexString(i));
while (s.length() < w)
s = "0" + s;
- return s.toUpperCase();
+ return StringUtils.toUpperCase(s);
}
private AnnotationWriter annotationWriter;
diff -r aec1999bb1fa -r f9f06fcca59d langtools/src/share/classes/com/sun/tools/javap/TypeAnnotationWriter.java
--- a/langtools/src/share/classes/com/sun/tools/javap/TypeAnnotationWriter.java Tue Dec 17 10:55:58 2013 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javap/TypeAnnotationWriter.java Tue Dec 17 10:55:59 2013 +0100
@@ -37,6 +37,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import com.sun.tools.javac.util.StringUtils;
/**
* Annotate instructions with details about type annotations.
@@ -115,7 +116,7 @@
print("@");
annotationWriter.write(n.anno, false, true);
print(", ");
- println(n.kind.toString().toLowerCase());
+ println(StringUtils.toLowerCase(n.kind.toString()));
}
}
}
diff -r aec1999bb1fa -r f9f06fcca59d langtools/src/share/classes/com/sun/tools/sjavac/server/CompilerThread.java
--- a/langtools/src/share/classes/com/sun/tools/sjavac/server/CompilerThread.java Tue Dec 17 10:55:58 2013 +0100
+++ b/langtools/src/share/classes/com/sun/tools/sjavac/server/CompilerThread.java Tue Dec 17 10:55:59 2013 +0100
@@ -49,6 +49,7 @@
import com.sun.tools.javac.util.Context;
import com.sun.tools.javac.util.Log;
import com.sun.tools.javac.util.BaseFileManager;
+import com.sun.tools.javac.util.StringUtils;
import com.sun.tools.sjavac.comp.Dependencies;
import com.sun.tools.sjavac.comp.JavaCompilerWithDeps;
import com.sun.tools.sjavac.comp.SmartFileManager;
@@ -256,7 +257,7 @@
// Load visible sources
Set