Author: remy.maucherat(a)jboss.com
Date: 2010-05-17 13:46:58 -0400 (Mon, 17 May 2010)
New Revision: 1473
Modified:
trunk/java/org/apache/catalina/core/StandardEngine.java
trunk/java/org/apache/catalina/core/StandardHost.java
trunk/java/org/apache/catalina/deploy/FilterMap.java
trunk/java/org/apache/catalina/servlets/CGIServlet.java
trunk/java/org/apache/catalina/servlets/WebdavServlet.java
trunk/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java
trunk/java/org/apache/catalina/ssi/SSIMediator.java
trunk/java/org/apache/catalina/ssi/SSIProcessor.java
trunk/java/org/apache/catalina/ssi/SSIServlet.java
trunk/java/org/apache/catalina/ssi/SSIServletExternalResolver.java
trunk/java/org/apache/catalina/util/ExtensionValidator.java
trunk/java/org/apache/catalina/util/MIME2Java.java
trunk/java/org/apache/catalina/util/URL.java
trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
trunk/java/org/apache/coyote/http11/Http11Processor.java
trunk/java/org/apache/jasper/compiler/Validator.java
trunk/java/org/apache/jasper/tagplugins/jstl/Util.java
trunk/java/org/apache/tomcat/util/buf/MessageBytes.java
trunk/java/org/apache/tomcat/util/http/AcceptLanguage.java
trunk/java/org/apache/tomcat/util/http/MimeMap.java
trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeadersImpl.java
trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java
trunk/java/org/apache/tomcat/util/http/fileupload/ServletFileUpload.java
trunk/java/org/apache/tomcat/util/modeler/OperationInfo.java
trunk/java/org/apache/tomcat/util/net/URL.java
trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java
trunk/java/org/jboss/web/php/ScriptEnvironment.java
trunk/java/org/jboss/web/rewrite/RewriteCond.java
Log:
- Specify locale rather than use the default.
Modified: trunk/java/org/apache/catalina/core/StandardEngine.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardEngine.java 2010-05-17 09:28:32 UTC (rev
1472)
+++ trunk/java/org/apache/catalina/core/StandardEngine.java 2010-05-17 17:46:58 UTC (rev
1473)
@@ -21,6 +21,7 @@
import java.io.File;
import java.util.List;
+import java.util.Locale;
import javax.management.MBeanServer;
import javax.management.MalformedObjectNameException;
@@ -144,7 +145,7 @@
if (host == null) {
this.defaultHost = null;
} else {
- this.defaultHost = host.toLowerCase();
+ this.defaultHost = host.toLowerCase(Locale.ENGLISH);
}
support.firePropertyChange("defaultHost", oldDefaultHost,
this.defaultHost);
Modified: trunk/java/org/apache/catalina/core/StandardHost.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardHost.java 2010-05-17 09:28:32 UTC (rev
1472)
+++ trunk/java/org/apache/catalina/core/StandardHost.java 2010-05-17 17:46:58 UTC (rev
1473)
@@ -19,6 +19,8 @@
package org.apache.catalina.core;
+import java.util.Locale;
+
import javax.management.MBeanServer;
import javax.management.ObjectName;
@@ -259,7 +261,7 @@
throw new IllegalArgumentException
(sm.getString("standardHost.nullName"));
- name = name.toLowerCase(); // Internally all names are lower case
+ name = name.toLowerCase(Locale.ENGLISH); // Internally all names are lower
case
String oldName = this.name;
this.name = name;
@@ -296,7 +298,7 @@
*/
public void addAlias(String alias) {
- alias = alias.toLowerCase();
+ alias = alias.toLowerCase(Locale.ENGLISH);
// Skip duplicate aliases
for (int i = 0; i < aliases.length; i++) {
@@ -364,7 +366,7 @@
*/
public void removeAlias(String alias) {
- alias = alias.toLowerCase();
+ alias = alias.toLowerCase(Locale.ENGLISH);
// Make sure this alias is currently present
int n = -1;
Modified: trunk/java/org/apache/catalina/deploy/FilterMap.java
===================================================================
--- trunk/java/org/apache/catalina/deploy/FilterMap.java 2010-05-17 09:28:32 UTC (rev
1472)
+++ trunk/java/org/apache/catalina/deploy/FilterMap.java 2010-05-17 17:46:58 UTC (rev
1473)
@@ -20,6 +20,7 @@
import java.io.Serializable;
+import java.util.Locale;
import javax.servlet.DispatcherType;
@@ -136,7 +137,7 @@
* representing the state of when filters should be applied.
*/
public void setDispatcher(String dispatcherString) {
- String dispatcher = dispatcherString.toUpperCase();
+ String dispatcher = dispatcherString.toUpperCase(Locale.ENGLISH);
if (dispatcher.equals(DispatcherType.FORWARD.name())) {
// apply FORWARD to the global dispatcherMapping.
Modified: trunk/java/org/apache/catalina/servlets/CGIServlet.java
===================================================================
--- trunk/java/org/apache/catalina/servlets/CGIServlet.java 2010-05-17 09:28:32 UTC (rev
1472)
+++ trunk/java/org/apache/catalina/servlets/CGIServlet.java 2010-05-17 17:46:58 UTC (rev
1473)
@@ -1063,7 +1063,7 @@
String header = null;
while (headers.hasMoreElements()) {
header = null;
- header = headers.nextElement().toUpperCase();
+ header = headers.nextElement().toUpperCase(Locale.ENGLISH);
//REMIND: rewrite multiple headers as if received as single
//REMIND: change character set
//REMIND: I forgot what the previous REMIND means
Modified: trunk/java/org/apache/catalina/servlets/WebdavServlet.java
===================================================================
--- trunk/java/org/apache/catalina/servlets/WebdavServlet.java 2010-05-17 09:28:32 UTC
(rev 1472)
+++ trunk/java/org/apache/catalina/servlets/WebdavServlet.java 2010-05-17 17:46:58 UTC
(rev 1473)
@@ -30,6 +30,7 @@
import java.util.Date;
import java.util.Enumeration;
import java.util.Hashtable;
+import java.util.Locale;
import java.util.Stack;
import java.util.TimeZone;
import java.util.Vector;
@@ -435,8 +436,8 @@
if (path.endsWith("/"))
path = path.substring(0, path.length() - 1);
- if ((path.toUpperCase().startsWith("/WEB-INF")) ||
- (path.toUpperCase().startsWith("/META-INF"))) {
+ if ((path.toUpperCase(Locale.ENGLISH).startsWith("/WEB-INF")) ||
+ (path.toUpperCase(Locale.ENGLISH).startsWith("/META-INF"))) {
resp.sendError(WebdavStatus.SC_FORBIDDEN);
return;
}
@@ -711,8 +712,8 @@
String path = getRelativePath(req);
- if ((path.toUpperCase().startsWith("/WEB-INF")) ||
- (path.toUpperCase().startsWith("/META-INF"))) {
+ if ((path.toUpperCase(Locale.ENGLISH).startsWith("/WEB-INF")) ||
+ (path.toUpperCase(Locale.ENGLISH).startsWith("/META-INF"))) {
resp.sendError(WebdavStatus.SC_FORBIDDEN);
return;
}
@@ -1595,16 +1596,16 @@
if (debug > 0)
log("Dest path :" + destinationPath);
- if ((destinationPath.toUpperCase().startsWith("/WEB-INF")) ||
- (destinationPath.toUpperCase().startsWith("/META-INF"))) {
+ if
((destinationPath.toUpperCase(Locale.ENGLISH).startsWith("/WEB-INF")) ||
+
(destinationPath.toUpperCase(Locale.ENGLISH).startsWith("/META-INF"))) {
resp.sendError(WebdavStatus.SC_FORBIDDEN);
return false;
}
String path = getRelativePath(req);
- if ((path.toUpperCase().startsWith("/WEB-INF")) ||
- (path.toUpperCase().startsWith("/META-INF"))) {
+ if ((path.toUpperCase(Locale.ENGLISH).startsWith("/WEB-INF")) ||
+ (path.toUpperCase(Locale.ENGLISH).startsWith("/META-INF"))) {
resp.sendError(WebdavStatus.SC_FORBIDDEN);
return false;
}
@@ -1798,8 +1799,8 @@
HttpServletResponse resp, boolean setStatus)
throws ServletException, IOException {
- if ((path.toUpperCase().startsWith("/WEB-INF")) ||
- (path.toUpperCase().startsWith("/META-INF"))) {
+ if ((path.toUpperCase(Locale.ENGLISH).startsWith("/WEB-INF")) ||
+ (path.toUpperCase(Locale.ENGLISH).startsWith("/META-INF"))) {
resp.sendError(WebdavStatus.SC_FORBIDDEN);
return false;
}
@@ -1883,8 +1884,8 @@
if (debug > 1)
log("Delete:" + path);
- if ((path.toUpperCase().startsWith("/WEB-INF")) ||
- (path.toUpperCase().startsWith("/META-INF"))) {
+ if ((path.toUpperCase(Locale.ENGLISH).startsWith("/WEB-INF")) ||
+ (path.toUpperCase(Locale.ENGLISH).startsWith("/META-INF"))) {
errorList.put(path, new Integer(WebdavStatus.SC_FORBIDDEN));
return;
}
@@ -2023,8 +2024,8 @@
// Exclude any resource in the /WEB-INF and /META-INF subdirectories
// (the "toUpperCase()" avoids problems on Windows systems)
- if (path.toUpperCase().startsWith("/WEB-INF") ||
- path.toUpperCase().startsWith("/META-INF"))
+ if (path.toUpperCase(Locale.ENGLISH).startsWith("/WEB-INF") ||
+ path.toUpperCase(Locale.ENGLISH).startsWith("/META-INF"))
return;
CacheEntry cacheEntry = resources.lookupCache(path);
@@ -2316,8 +2317,8 @@
// Exclude any resource in the /WEB-INF and /META-INF subdirectories
// (the "toUpperCase()" avoids problems on Windows systems)
- if (path.toUpperCase().startsWith("/WEB-INF") ||
- path.toUpperCase().startsWith("/META-INF"))
+ if (path.toUpperCase(Locale.ENGLISH).startsWith("/WEB-INF") ||
+ path.toUpperCase(Locale.ENGLISH).startsWith("/META-INF"))
return;
// Retrieving the lock associated with the lock-null resource
Modified: trunk/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java
===================================================================
--- trunk/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java 2010-05-17 09:28:32 UTC
(rev 1472)
+++ trunk/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java 2010-05-17 17:46:58 UTC
(rev 1473)
@@ -207,7 +207,7 @@
public void addDateHeader(String name, long value) {
super.addDateHeader(name, value);
- String lname = name.toLowerCase();
+ String lname = name.toLowerCase(Locale.ENGLISH);
if (lname.equals(LAST_MODIFIED)) {
lastModified = value;
}
@@ -215,7 +215,7 @@
public void addHeader(String name, String value) {
super.addHeader(name, value);
- String lname = name.toLowerCase();
+ String lname = name.toLowerCase(Locale.ENGLISH);
if (lname.equals(LAST_MODIFIED)) {
try {
synchronized(RFC1123_FORMAT) {
@@ -229,7 +229,7 @@
public void setDateHeader(String name, long value) {
super.setDateHeader(name, value);
- String lname = name.toLowerCase();
+ String lname = name.toLowerCase(Locale.ENGLISH);
if (lname.equals(LAST_MODIFIED)) {
lastModified = value;
}
@@ -237,7 +237,7 @@
public void setHeader(String name, String value) {
super.setHeader(name, value);
- String lname = name.toLowerCase();
+ String lname = name.toLowerCase(Locale.ENGLISH);
if (lname.equals(LAST_MODIFIED)) {
try {
synchronized(RFC1123_FORMAT) {
Modified: trunk/java/org/apache/catalina/ssi/SSIMediator.java
===================================================================
--- trunk/java/org/apache/catalina/ssi/SSIMediator.java 2010-05-17 09:28:32 UTC (rev
1472)
+++ trunk/java/org/apache/catalina/ssi/SSIMediator.java 2010-05-17 17:46:58 UTC (rev
1473)
@@ -22,6 +22,7 @@
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.Locale;
import java.util.Set;
import java.util.TimeZone;
import org.apache.catalina.util.DateTool;
@@ -181,7 +182,7 @@
public String getVariableValue(String variableName, String encoding) {
- String lowerCaseVariableName = variableName.toLowerCase();
+ String lowerCaseVariableName = variableName.toLowerCase(Locale.ENGLISH);
String variableValue = null;
if (!isNameReserved(lowerCaseVariableName)) {
//Try getting it externally first, if it fails, try getting the
@@ -189,7 +190,7 @@
// value
variableValue = ssiExternalResolver.getVariableValue(variableName);
if (variableValue == null) {
- variableName = variableName.toUpperCase();
+ variableName = variableName.toUpperCase(Locale.ENGLISH);
variableValue = (String)ssiExternalResolver
.getVariableValue(className + "." + variableName);
}
Modified: trunk/java/org/apache/catalina/ssi/SSIProcessor.java
===================================================================
--- trunk/java/org/apache/catalina/ssi/SSIProcessor.java 2010-05-17 09:28:32 UTC (rev
1472)
+++ trunk/java/org/apache/catalina/ssi/SSIProcessor.java 2010-05-17 17:46:58 UTC (rev
1473)
@@ -22,6 +22,7 @@
import java.io.Reader;
import java.io.StringWriter;
import java.util.HashMap;
+import java.util.Locale;
import java.util.StringTokenizer;
import org.apache.catalina.util.IOTools;
/**
@@ -133,7 +134,7 @@
// during the loop
String configErrMsg = ssiMediator.getConfigErrMsg();
SSICommand ssiCommand = (SSICommand)commands
- .get(strCmd.toLowerCase());
+ .get(strCmd.toLowerCase(Locale.ENGLISH));
String errorMessage = null;
if (ssiCommand == null) {
errorMessage = "Unknown command: " + strCmd;
Modified: trunk/java/org/apache/catalina/ssi/SSIServlet.java
===================================================================
--- trunk/java/org/apache/catalina/ssi/SSIServlet.java 2010-05-17 09:28:32 UTC (rev 1472)
+++ trunk/java/org/apache/catalina/ssi/SSIServlet.java 2010-05-17 17:46:58 UTC (rev 1473)
@@ -25,6 +25,8 @@
import java.io.StringWriter;
import java.net.URL;
import java.net.URLConnection;
+import java.util.Locale;
+
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
@@ -144,8 +146,8 @@
+ path + "'");
// Exclude any resource in the /WEB-INF and /META-INF subdirectories
// (the "toUpperCase()" avoids problems on Windows systems)
- if (path == null || path.toUpperCase().startsWith("/WEB-INF")
- || path.toUpperCase().startsWith("/META-INF")) {
+ if (path == null ||
path.toUpperCase(Locale.ENGLISH).startsWith("/WEB-INF")
+ || path.toUpperCase(Locale.ENGLISH).startsWith("/META-INF")) {
res.sendError(HttpServletResponse.SC_NOT_FOUND, path);
log("Can't serve file: " + path);
return;
Modified: trunk/java/org/apache/catalina/ssi/SSIServletExternalResolver.java
===================================================================
--- trunk/java/org/apache/catalina/ssi/SSIServletExternalResolver.java 2010-05-17 09:28:32
UTC (rev 1472)
+++ trunk/java/org/apache/catalina/ssi/SSIServletExternalResolver.java 2010-05-17 17:46:58
UTC (rev 1473)
@@ -25,6 +25,8 @@
import java.util.Collection;
import java.util.Date;
import java.util.Enumeration;
+import java.util.Locale;
+
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
@@ -149,7 +151,7 @@
protected String getCGIVariable(String name) {
String retVal = null;
- String[] nameParts = name.toUpperCase().split("_");
+ String[] nameParts = name.toUpperCase(Locale.ENGLISH).split("_");
int requiredParts = 2;
if (nameParts.length == 1) {
if (nameParts[0].equals("PATH")) {
Modified: trunk/java/org/apache/catalina/util/ExtensionValidator.java
===================================================================
--- trunk/java/org/apache/catalina/util/ExtensionValidator.java 2010-05-17 09:28:32 UTC
(rev 1472)
+++ trunk/java/org/apache/catalina/util/ExtensionValidator.java 2010-05-17 17:46:58 UTC
(rev 1473)
@@ -23,6 +23,7 @@
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Iterator;
+import java.util.Locale;
import java.util.NoSuchElementException;
import java.util.StringTokenizer;
import java.util.jar.JarInputStream;
@@ -87,7 +88,7 @@
// build a list of jar files in the classpath
while (strTok.hasMoreTokens()) {
String classpathItem = strTok.nextToken();
- if (classpathItem.toLowerCase().endsWith(".jar")) {
+ if (classpathItem.toLowerCase(Locale.ENGLISH).endsWith(".jar")) {
File item = new File(classpathItem);
if (item.exists()) {
try {
@@ -142,7 +143,7 @@
try {
NamingEnumeration wne = dirContext.listBindings("/META-INF/");
Binding binding = (Binding) wne.nextElement();
- if (binding.getName().toUpperCase().equals("MANIFEST.MF")) {
+ if
(binding.getName().toUpperCase(Locale.ENGLISH).equals("MANIFEST.MF")) {
Resource resource = (Resource)dirContext.lookup
("/META-INF/" + binding.getName());
inputStream = resource.streamContent();
@@ -176,7 +177,7 @@
}
while ((ne != null) && ne.hasMoreElements()) {
Binding binding = (Binding)ne.nextElement();
- if (!binding.getName().toLowerCase().endsWith(".jar")) {
+ if
(!binding.getName().toLowerCase(Locale.ENGLISH).endsWith(".jar")) {
continue;
}
Object resourceObject = dirContext.lookup("/WEB-INF/lib/" +
binding.getName());
@@ -407,7 +408,7 @@
}
File[] files = targetDir.listFiles();
for (int i = 0; i < files.length; i++) {
- if (files[i].getName().toLowerCase().endsWith(".jar")) {
+ if
(files[i].getName().toLowerCase(Locale.ENGLISH).endsWith(".jar")) {
try {
addSystemResource(files[i]);
} catch (IOException e) {
Modified: trunk/java/org/apache/catalina/util/MIME2Java.java
===================================================================
--- trunk/java/org/apache/catalina/util/MIME2Java.java 2010-05-17 09:28:32 UTC (rev 1472)
+++ trunk/java/org/apache/catalina/util/MIME2Java.java 2010-05-17 17:46:58 UTC (rev 1473)
@@ -580,7 +580,7 @@
* @see #reverse
*/
public static String convert(String mimeCharsetName) {
- return (String)s_enchash.get(mimeCharsetName.toUpperCase());
+ return (String)s_enchash.get(mimeCharsetName.toUpperCase(Locale.ENGLISH));
}
/**
@@ -598,6 +598,6 @@
* @see #convert
*/
public static String reverse(String encoding) {
- return (String)s_revhash.get(encoding.toUpperCase());
+ return (String)s_revhash.get(encoding.toUpperCase(Locale.ENGLISH));
}
}
Modified: trunk/java/org/apache/catalina/util/URL.java
===================================================================
--- trunk/java/org/apache/catalina/util/URL.java 2010-05-17 09:28:32 UTC (rev 1472)
+++ trunk/java/org/apache/catalina/util/URL.java 2010-05-17 17:46:58 UTC (rev 1473)
@@ -21,6 +21,7 @@
import java.io.Serializable;
import java.net.MalformedURLException;
+import java.util.Locale;
/**
@@ -111,7 +112,7 @@
for (i = start; !aRef && (i < limit) &&
((c = spec.charAt(i)) != '/'); i++) {
if (c == ':') {
- String s = spec.substring(start, i).toLowerCase();
+ String s = spec.substring(start, i).toLowerCase(Locale.ENGLISH);
// Assume all protocols are valid
newProtocol = s;
start = i + 1;
Modified: trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 2010-05-17 09:28:32 UTC
(rev 1472)
+++ trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 2010-05-17 17:46:58 UTC
(rev 1473)
@@ -20,6 +20,7 @@
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InterruptedIOException;
+import java.util.Locale;
import java.util.StringTokenizer;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
@@ -1438,7 +1439,7 @@
String encodingName = null;
while (commaPos != -1) {
encodingName = transferEncodingValue.substring
- (startPos, commaPos).toLowerCase().trim();
+ (startPos, commaPos).toLowerCase(Locale.ENGLISH).trim();
if (!addInputFilter(inputFilters, encodingName)) {
// Unsupported transfer encoding
error = true;
@@ -1449,7 +1450,7 @@
commaPos = transferEncodingValue.indexOf(',', startPos);
}
encodingName = transferEncodingValue.substring(startPos)
- .toLowerCase().trim();
+ .toLowerCase(Locale.ENGLISH).trim();
if (!addInputFilter(inputFilters, encodingName)) {
// Unsupported transfer encoding
error = true;
Modified: trunk/java/org/apache/coyote/http11/Http11Processor.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11Processor.java 2010-05-17 09:28:32 UTC (rev
1472)
+++ trunk/java/org/apache/coyote/http11/Http11Processor.java 2010-05-17 17:46:58 UTC (rev
1473)
@@ -26,6 +26,7 @@
import java.io.InterruptedIOException;
import java.net.InetAddress;
import java.net.Socket;
+import java.util.Locale;
import java.util.StringTokenizer;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
@@ -1330,7 +1331,7 @@
String encodingName = null;
while (commaPos != -1) {
encodingName = transferEncodingValue.substring
- (startPos, commaPos).toLowerCase().trim();
+ (startPos, commaPos).toLowerCase(Locale.ENGLISH).trim();
if (!addInputFilter(inputFilters, encodingName)) {
// Unsupported transfer encoding
error = true;
@@ -1341,7 +1342,7 @@
commaPos = transferEncodingValue.indexOf(',', startPos);
}
encodingName = transferEncodingValue.substring(startPos)
- .toLowerCase().trim();
+ .toLowerCase(Locale.ENGLISH).trim();
if (!addInputFilter(inputFilters, encodingName)) {
// Unsupported transfer encoding
error = true;
Modified: trunk/java/org/apache/jasper/compiler/Validator.java
===================================================================
--- trunk/java/org/apache/jasper/compiler/Validator.java 2010-05-17 09:28:32 UTC (rev
1472)
+++ trunk/java/org/apache/jasper/compiler/Validator.java 2010-05-17 17:46:58 UTC (rev
1473)
@@ -22,6 +22,7 @@
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
+import java.util.Locale;
import javax.el.ELException;
import javax.el.ExpressionFactory;
@@ -327,7 +328,7 @@
Node.Root root = pageDir.getRoot();
String configEnc = root.getJspConfigPageEncoding();
- String pageDirEnc = thePageDirEnc.toUpperCase();
+ String pageDirEnc = thePageDirEnc.toUpperCase(Locale.ENGLISH);
/*
* Compare the 'pageEncoding' attribute of the page directive with
@@ -336,7 +337,7 @@
* "UTF-16LE" as identical.
*/
if (configEnc != null) {
- configEnc = configEnc.toUpperCase();
+ configEnc = configEnc.toUpperCase(Locale.ENGLISH);
if (!pageDirEnc.equals(configEnc)
&& (!pageDirEnc.startsWith("UTF-16") ||
!configEnc
.startsWith("UTF-16"))) {
@@ -356,7 +357,7 @@
* identical.
*/
if ((root.isXmlSyntax() && root.isEncodingSpecifiedInProlog()) ||
root.isBomPresent()) {
- String pageEnc = root.getPageEncoding().toUpperCase();
+ String pageEnc = root.getPageEncoding().toUpperCase(Locale.ENGLISH);
if (!pageDirEnc.equals(pageEnc)
&& (!pageDirEnc.startsWith("UTF-16") ||
!pageEnc
.startsWith("UTF-16"))) {
Modified: trunk/java/org/apache/jasper/tagplugins/jstl/Util.java
===================================================================
--- trunk/java/org/apache/jasper/tagplugins/jstl/Util.java 2010-05-17 09:28:32 UTC (rev
1472)
+++ trunk/java/org/apache/jasper/tagplugins/jstl/Util.java 2010-05-17 17:46:58 UTC (rev
1473)
@@ -119,7 +119,7 @@
public static String getContentTypeAttribute(String input, String name) {
int begin;
int end;
- int index = input.toUpperCase().indexOf(name.toUpperCase());
+ int index =
input.toUpperCase(Locale.ENGLISH).indexOf(name.toUpperCase(Locale.ENGLISH));
if (index == -1) return null;
index = index + name.length(); // positioned after the attribute name
index = input.indexOf('=', index); // positioned at the '='
Modified: trunk/java/org/apache/tomcat/util/buf/MessageBytes.java
===================================================================
--- trunk/java/org/apache/tomcat/util/buf/MessageBytes.java 2010-05-17 09:28:32 UTC (rev
1472)
+++ trunk/java/org/apache/tomcat/util/buf/MessageBytes.java 2010-05-17 17:46:58 UTC (rev
1473)
@@ -19,6 +19,7 @@
import java.io.IOException;
import java.io.Serializable;
+import java.util.Locale;
/**
* This class is used to represent a subarray of bytes in an HTTP message.
@@ -481,8 +482,8 @@
public int indexOfIgnoreCase(String s, int starting) {
toString();
- String upper=strValue.toUpperCase();
- String sU=s.toUpperCase();
+ String upper=strValue.toUpperCase(Locale.ENGLISH);
+ String sU=s.toUpperCase(Locale.ENGLISH);
return upper.indexOf( sU, starting );
}
Modified: trunk/java/org/apache/tomcat/util/http/AcceptLanguage.java
===================================================================
--- trunk/java/org/apache/tomcat/util/http/AcceptLanguage.java 2010-05-17 09:28:32 UTC
(rev 1472)
+++ trunk/java/org/apache/tomcat/util/http/AcceptLanguage.java 2010-05-17 17:46:58 UTC
(rev 1473)
@@ -92,7 +92,7 @@
qIndex < equalIndex) {
String qValueStr = language.substring(qValueIndex + 1);
language = language.substring(0, qValueIndex);
- qValueStr = qValueStr.trim().toLowerCase();
+ qValueStr = qValueStr.trim().toLowerCase(Locale.ENGLISH);
qValueIndex = qValueStr.indexOf('=');
qValue = new Double(0);
if (qValueStr.startsWith("q") &&
Modified: trunk/java/org/apache/tomcat/util/http/MimeMap.java
===================================================================
--- trunk/java/org/apache/tomcat/util/http/MimeMap.java 2010-05-17 09:28:32 UTC (rev
1472)
+++ trunk/java/org/apache/tomcat/util/http/MimeMap.java 2010-05-17 17:46:58 UTC (rev
1473)
@@ -137,7 +137,7 @@
private Hashtable map = new Hashtable();
public void addContentType(String extn, String type) {
- map.put(extn, type.toLowerCase());
+ map.put(extn, type.toLowerCase(Locale.ENGLISH));
}
public Enumeration getExtensions() {
@@ -149,13 +149,13 @@
}
public String getContentType(String extn) {
- String type = (String)map.get(extn.toLowerCase());
+ String type = (String)map.get(extn.toLowerCase(Locale.ENGLISH));
if( type == null ) type=(String)defaultMap.get( extn );
return type;
}
public void removeContentType(String extn) {
- map.remove(extn.toLowerCase());
+ map.remove(extn.toLowerCase(Locale.ENGLISH));
}
/** Get extension of file, without fragment id
Modified: trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeadersImpl.java
===================================================================
--- trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeadersImpl.java 2010-05-17
09:28:32 UTC (rev 1472)
+++ trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeadersImpl.java 2010-05-17
17:46:58 UTC (rev 1473)
@@ -22,6 +22,7 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
@@ -49,7 +50,7 @@
private final List<String> headerNameList = new ArrayList<String>();
public String getHeader(String name) {
- String nameLower = name.toLowerCase();
+ String nameLower = name.toLowerCase(Locale.ENGLISH);
List<String> headerValueList = headerNameToValueListMap.get(nameLower);
if (null == headerValueList) {
return null;
@@ -62,7 +63,7 @@
}
public Iterator<String> getHeaders(String name) {
- String nameLower = name.toLowerCase();
+ String nameLower = name.toLowerCase(Locale.ENGLISH);
List<String> headerValueList = headerNameToValueListMap.get(nameLower);
if (null == headerValueList) {
return Collections.<String>emptyList().iterator();
@@ -77,7 +78,7 @@
* @param value value of this header
*/
public synchronized void addHeader(String name, String value) {
- String nameLower = name.toLowerCase();
+ String nameLower = name.toLowerCase(Locale.ENGLISH);
List<String> headerValueList = headerNameToValueListMap.get(nameLower);
if (null == headerValueList) {
headerValueList = new ArrayList<String>();
Modified: trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java
===================================================================
--- trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java 2010-05-17
09:28:32 UTC (rev 1472)
+++ trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java 2010-05-17
17:46:58 UTC (rev 1473)
@@ -21,6 +21,7 @@
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.NoSuchElementException;
@@ -76,7 +77,7 @@
if (contentType == null) {
return false;
}
- if (contentType.toLowerCase().startsWith(MULTIPART)) {
+ if (contentType.toLowerCase(Locale.ENGLISH).startsWith(MULTIPART)) {
return true;
}
return false;
@@ -382,7 +383,7 @@
private String getFileName(String pContentDisposition) {
String fileName = null;
if (pContentDisposition != null) {
- String cdl = pContentDisposition.toLowerCase();
+ String cdl = pContentDisposition.toLowerCase(Locale.ENGLISH);
if (cdl.startsWith(FORM_DATA) || cdl.startsWith(ATTACHMENT)) {
ParameterParser parser = new ParameterParser();
parser.setLowerCaseNames(true);
@@ -427,7 +428,7 @@
private String getFieldName(String pContentDisposition) {
String fieldName = null;
if (pContentDisposition != null
- && pContentDisposition.toLowerCase().startsWith(FORM_DATA)) {
+ &&
pContentDisposition.toLowerCase(Locale.ENGLISH).startsWith(FORM_DATA)) {
ParameterParser parser = new ParameterParser();
parser.setLowerCaseNames(true);
// Parameter parser can handle null input
@@ -738,7 +739,7 @@
String contentType = ctx.getContentType();
if ((null == contentType)
- || (!contentType.toLowerCase().startsWith(MULTIPART))) {
+ || (!contentType.toLowerCase(Locale.ENGLISH).startsWith(MULTIPART)))
{
throw new InvalidContentTypeException(
"the request doesn't contain a "
+ MULTIPART_FORM_DATA
@@ -838,7 +839,7 @@
if (fieldName != null) {
String subContentType = headers.getHeader(CONTENT_TYPE);
if (subContentType != null
- && subContentType.toLowerCase()
+ && subContentType.toLowerCase(Locale.ENGLISH)
.startsWith(MULTIPART_MIXED)) {
currentFieldName = fieldName;
// Multiple files associated with this field name
Modified: trunk/java/org/apache/tomcat/util/http/fileupload/ServletFileUpload.java
===================================================================
--- trunk/java/org/apache/tomcat/util/http/fileupload/ServletFileUpload.java 2010-05-17
09:28:32 UTC (rev 1472)
+++ trunk/java/org/apache/tomcat/util/http/fileupload/ServletFileUpload.java 2010-05-17
17:46:58 UTC (rev 1473)
@@ -18,6 +18,7 @@
import java.io.IOException;
import java.util.List;
+import java.util.Locale;
import javax.servlet.http.HttpServletRequest;
@@ -61,7 +62,7 @@
*/
public static final boolean isMultipartContent(
HttpServletRequest request) {
- if (!"post".equals(request.getMethod().toLowerCase())) {
+ if (!"post".equals(request.getMethod().toLowerCase(Locale.ENGLISH))) {
return false;
}
String contentType = request.getContentType();
Modified: trunk/java/org/apache/tomcat/util/modeler/OperationInfo.java
===================================================================
--- trunk/java/org/apache/tomcat/util/modeler/OperationInfo.java 2010-05-17 09:28:32 UTC
(rev 1472)
+++ trunk/java/org/apache/tomcat/util/modeler/OperationInfo.java 2010-05-17 17:46:58 UTC
(rev 1473)
@@ -20,6 +20,7 @@
import java.io.Serializable;
+import java.util.Locale;
import javax.management.MBeanOperationInfo;
import javax.management.MBeanParameterInfo;
@@ -66,7 +67,7 @@
if (impact == null)
this.impact = null;
else
- this.impact = impact.toUpperCase();
+ this.impact = impact.toUpperCase(Locale.ENGLISH);
}
Modified: trunk/java/org/apache/tomcat/util/net/URL.java
===================================================================
--- trunk/java/org/apache/tomcat/util/net/URL.java 2010-05-17 09:28:32 UTC (rev 1472)
+++ trunk/java/org/apache/tomcat/util/net/URL.java 2010-05-17 17:46:58 UTC (rev 1473)
@@ -20,6 +20,7 @@
import java.io.Serializable;
import java.net.MalformedURLException;
+import java.util.Locale;
/**
@@ -110,7 +111,7 @@
for (i = start; !aRef && (i < limit) ; i++) {
c = spec.charAt(i);
if (c == ':') {
- String s = spec.substring(start, i).toLowerCase();
+ String s = spec.substring(start, i).toLowerCase(Locale.ENGLISH);
// Assume all protocols are valid
newProtocol = s;
start = i + 1;
Modified: trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java
===================================================================
--- trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java 2010-05-17 09:28:32
UTC (rev 1472)
+++ trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java 2010-05-17 17:46:58
UTC (rev 1473)
@@ -39,6 +39,7 @@
import java.security.cert.PKIXBuilderParameters;
import java.security.cert.X509CertSelector;
import java.util.Collection;
+import java.util.Locale;
import java.util.Vector;
import javax.net.ssl.CertPathTrustManagerParameters;
@@ -511,7 +512,7 @@
kms = kmf.getKeyManagers();
if (keyAlias != null) {
if (JSSESocketFactory.defaultKeystoreType.equals(keystoreType)) {
- keyAlias = keyAlias.toLowerCase();
+ keyAlias = keyAlias.toLowerCase(Locale.ENGLISH);
}
for(int i=0; i<kms.length; i++) {
kms[i] = new JSSEKeyManager((X509KeyManager)kms[i], keyAlias);
Modified: trunk/java/org/jboss/web/php/ScriptEnvironment.java
===================================================================
--- trunk/java/org/jboss/web/php/ScriptEnvironment.java 2010-05-17 09:28:32 UTC (rev
1472)
+++ trunk/java/org/jboss/web/php/ScriptEnvironment.java 2010-05-17 17:46:58 UTC (rev
1473)
@@ -30,6 +30,7 @@
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Hashtable;
+import java.util.Locale;
import java.util.StringTokenizer;
import java.util.Vector;
@@ -468,7 +469,7 @@
while (headers.hasMoreElements()) {
header = null;
- header = ((String)headers.nextElement()).toUpperCase();
+ header = ((String)headers.nextElement()).toUpperCase(Locale.ENGLISH);
//REMIND: rewrite multiple headers as if received as single
//REMIND: change character set
//REMIND: I forgot what the previous REMIND means
Modified: trunk/java/org/jboss/web/rewrite/RewriteCond.java
===================================================================
--- trunk/java/org/jboss/web/rewrite/RewriteCond.java 2010-05-17 09:28:32 UTC (rev 1472)
+++ trunk/java/org/jboss/web/rewrite/RewriteCond.java 2010-05-17 17:46:58 UTC (rev 1473)
@@ -23,6 +23,7 @@
package org.jboss.web.rewrite;
+import java.util.Locale;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -197,7 +198,7 @@
public boolean evaluate(Matcher rule, Matcher cond, Resolver resolver) {
String value = test.evaluate(rule, cond, resolver);
if (nocase) {
- value = value.toLowerCase();
+ value = value.toLowerCase(Locale.ENGLISH);
}
Condition condition = this.condition.get();
if (condition == null) {