This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/master by this push:
new 96dd052 avoid locale issues when changing case for known English words
96dd052 is described below
commit 96dd05239f6f642ed2e5fac1e7c339c6f6fa8d14
Author: Paul King <[email protected]>
AuthorDate: Sun Mar 15 09:44:21 2020 +1000
avoid locale issues when changing case for known English words
---
.../org/codehaus/groovy/tools/groovydoc/GroovyRootDocBuilder.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git
a/subprojects/groovy-groovydoc/src/main/java/org/codehaus/groovy/tools/groovydoc/GroovyRootDocBuilder.java
b/subprojects/groovy-groovydoc/src/main/java/org/codehaus/groovy/tools/groovydoc/GroovyRootDocBuilder.java
index 7497f4f..b739dae 100644
---
a/subprojects/groovy-groovydoc/src/main/java/org/codehaus/groovy/tools/groovydoc/GroovyRootDocBuilder.java
+++
b/subprojects/groovy-groovydoc/src/main/java/org/codehaus/groovy/tools/groovydoc/GroovyRootDocBuilder.java
@@ -29,6 +29,7 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.Properties;
import java.util.regex.Pattern;
@@ -215,14 +216,14 @@ public class GroovyRootDocBuilder {
}
private static String pruneTagFromFront(String description, String tag) {
- int index = Math.max(indexOfTag(description, tag.toLowerCase()),
indexOfTag(description, tag.toUpperCase()));
+ int index = Math.max(indexOfTag(description,
tag.toLowerCase(Locale.ENGLISH)), indexOfTag(description,
tag.toUpperCase(Locale.ENGLISH)));
if (index < 0) return description;
return description.substring(index);
}
private static String pruneTagFromEnd(String description, String tag) {
- int index = Math.max(description.lastIndexOf("<" + tag.toLowerCase() +
">"),
- description.lastIndexOf("<" + tag.toUpperCase() + ">"));
+ int index = Math.max(description.lastIndexOf("<" +
tag.toLowerCase(Locale.ENGLISH) + ">"),
+ description.lastIndexOf("<" + tag.toUpperCase(Locale.ENGLISH)
+ ">"));
if (index < 0) return description;
return description.substring(0, index);
}