Author: sebb
Date: Sun Apr 27 09:02:33 2008
New Revision: 651973
URL: http://svn.apache.org/viewvc?rev=651973&view=rev
Log:
Use Locale.ENGLISH for lower-casing
Modified:
jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java
jakarta/jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/ConversionUtils.java
jakarta/jmeter/trunk/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/sampler/JDBCSampler.java
Modified:
jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java
URL:
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java?rev=651973&r1=651972&r2=651973&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java
(original)
+++ jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java
Sun Apr 27 09:02:33 2008
@@ -621,7 +621,7 @@
// <META http-equiv="content-type" content="text/html;
charset=foobar">
// is now processed by
HTTPSampleResult#getDataEncodingWithDefault
final String CS_PFX = "charset="; // $NON-NLS-1$
- int cset = ct.toLowerCase().indexOf(CS_PFX);
+ int cset =
ct.toLowerCase(java.util.Locale.ENGLISH).indexOf(CS_PFX);
if (cset >= 0) {
// TODO - assumes charset is not followed by anything else
String charSet = ct.substring(cset + CS_PFX.length());
@@ -790,7 +790,7 @@
* @return the media type - e.g. text/html (without charset, if any)
*/
public String getMediaType() {
- return JOrphanUtils.trim(contentType," ;").toLowerCase();
+ return JOrphanUtils.trim(contentType,"
;").toLowerCase(java.util.Locale.ENGLISH);
}
/**
Modified: jakarta/jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java
URL:
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java?rev=651973&r1=651972&r2=651973&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java
(original)
+++ jakarta/jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java Sun
Apr 27 09:02:33 2008
@@ -393,8 +393,9 @@
if (key == null) {
return null;
}
- key = key.replace(' ', '_'); // TODO - why does it do this? //
$NON-NLS-1$ // $NON-NLS-2$
- key = key.toLowerCase(); // (it's been here since v1.1)
+ // Resource keys cannot contain spaces
+ key = key.replace(' ', '_'); // $NON-NLS-1$ // $NON-NLS-2$
+ key = key.toLowerCase(java.util.Locale.ENGLISH);
String resString = null;
try {
resString = resources.getString(key);
Modified:
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java
URL:
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java?rev=651973&r1=651972&r2=651973&view=diff
==============================================================================
---
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java
(original)
+++
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java
Sun Apr 27 09:02:33 2008
@@ -177,7 +177,7 @@
if (getDataEncodingNoDefault() == null &&
getContentType().startsWith("text/html")){ // $NON-NLS-1$
byte[] bytes=getResponseData();
// get the start of the file
- String prefix = new String(bytes,0,Math.min(bytes.length,
1000)).toLowerCase();
+ String prefix = new String(bytes,0,Math.min(bytes.length,
1000)).toLowerCase(java.util.Locale.ENGLISH);
// Extract the content-type if present
final String METATAG = "<meta http-equiv=\"content-type\"
content=\""; // $NON-NLS-1$
int tagstart=prefix.indexOf(METATAG);
Modified:
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/ConversionUtils.java
URL:
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/ConversionUtils.java?rev=651973&r1=651972&r2=651973&view=diff
==============================================================================
---
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/ConversionUtils.java
(original)
+++
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/ConversionUtils.java
Sun Apr 27 09:02:33 2008
@@ -42,7 +42,7 @@
public static String getEncodingFromContentType(String contentType){
String charSet = null;
if (contentType != null) {
- int charSetStartPos =
contentType.toLowerCase().indexOf(CHARSET_EQ);
+ int charSetStartPos =
contentType.toLowerCase(java.util.Locale.ENGLISH).indexOf(CHARSET_EQ);
if (charSetStartPos >= 0) {
charSet = contentType.substring(charSetStartPos +
CHARSET_EQ_LEN);
if (charSet != null) {
Modified:
jakarta/jmeter/trunk/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/sampler/JDBCSampler.java
URL:
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/sampler/JDBCSampler.java?rev=651973&r1=651972&r2=651973&view=diff
==============================================================================
---
jakarta/jmeter/trunk/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/sampler/JDBCSampler.java
(original)
+++
jakarta/jmeter/trunk/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/sampler/JDBCSampler.java
Sun Apr 27 09:02:33 2008
@@ -76,7 +76,7 @@
try {
String name = fields[i].getName();
Integer value = (Integer)fields[i].get(null);
- mapJdbcNameToInt.put(name.toLowerCase(),value);
+
mapJdbcNameToInt.put(name.toLowerCase(java.util.Locale.ENGLISH),value);
} catch (IllegalAccessException e) {
throw new RuntimeException(e); // should not happen
}
@@ -315,7 +315,7 @@
private static int getJdbcType(String jdbcType) throws SQLException {
- Integer entry = (Integer)mapJdbcNameToInt.get(jdbcType.toLowerCase());
+ Integer entry =
(Integer)mapJdbcNameToInt.get(jdbcType.toLowerCase(java.util.Locale.ENGLISH));
if (entry == null) {
throw new SQLException("Invalid data type: "+jdbcType);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]