replace more equalsIgnoreCase() calls

This commit is contained in:
zzz
2011-11-28 22:55:10 +00:00
parent 8619fd2c05
commit 6b811b36b9
17 changed files with 61 additions and 43 deletions

View File

@@ -13,6 +13,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Locale;
import java.util.Properties;
import java.util.Set;
@@ -59,7 +60,7 @@ class I2PSessionImpl2 extends I2PSessionImpl {
_log = ctx.logManager().getLog(I2PSessionImpl2.class);
_sendingStates = new HashSet(32);
// default is BestEffort
_noEffort = "none".equalsIgnoreCase(getOptions().getProperty(I2PClient.PROP_RELIABILITY));
_noEffort = "none".equals(getOptions().getProperty(I2PClient.PROP_RELIABILITY, "").toLowerCase(Locale.US));
ctx.statManager().createRateStat("i2cp.sendBestEffortTotalTime", "how long to do the full sendBestEffort call?", "i2cp", new long[] { 10*60*1000 } );
//ctx.statManager().createRateStat("i2cp.sendBestEffortStage0", "first part of sendBestEffort?", "i2cp", new long[] { 10*60*1000 } );

View File

@@ -11,6 +11,7 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Locale;
import net.i2p.util.Log;
@@ -72,7 +73,8 @@ public class Base32 {
}
private static void runApp(String args[]) {
if ("encodestring".equalsIgnoreCase(args[0])) {
String cmd = args[0].toLowerCase(Locale.US);
if ("encodestring".equals(cmd)) {
System.out.println(encode(args[1].getBytes()));
return;
}
@@ -85,11 +87,11 @@ public class Base32 {
if (args.length >= 2) {
in = new FileInputStream(args[1]);
}
if ("encode".equalsIgnoreCase(args[0])) {
if ("encode".equals(cmd)) {
encode(in, out);
return;
}
if ("decode".equalsIgnoreCase(args[0])) {
if ("decode".equals(cmd)) {
decode(in, out);
return;
}

View File

@@ -6,6 +6,7 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Locale;
import net.i2p.util.Log;
@@ -178,7 +179,8 @@ public class Base64 {
}
private static void runApp(String args[]) {
if ("encodestring".equalsIgnoreCase(args[0])) {
String cmd = args[0].toLowerCase(Locale.US);
if ("encodestring".equals(cmd)) {
System.out.println(encode(args[1].getBytes()));
return;
}
@@ -191,11 +193,11 @@ public class Base64 {
if (args.length >= 2) {
in = new FileInputStream(args[1]);
}
if ("encode".equalsIgnoreCase(args[0])) {
if ("encode".equals(cmd)) {
encode(in, out);
return;
}
if ("decode".equalsIgnoreCase(args[0])) {
if ("decode".equals(cmd)) {
decode(in, out);
return;
}

View File

@@ -939,27 +939,28 @@ public class EepGet {
if (_log.shouldLog(Log.DEBUG))
_log.debug("Header line: [" + key + "] = [" + val + "]");
if (key.equalsIgnoreCase("Content-length")) {
key = key.toLowerCase(Locale.US);
if (key.equals("content-length")) {
try {
_bytesRemaining = Long.parseLong(val);
} catch (NumberFormatException nfe) {
nfe.printStackTrace();
}
} else if (key.equalsIgnoreCase("ETag")) {
} else if (key.equals("etag")) {
_etag = val;
} else if (key.equalsIgnoreCase("Last-Modified")) {
} else if (key.equals("last-modified")) {
_lastModified = val;
} else if (key.equalsIgnoreCase("Transfer-encoding")) {
} else if (key.equals("transfer-encoding")) {
_encodingChunked = val.toLowerCase(Locale.US).contains("chunked");
} else if (key.equalsIgnoreCase("Content-encoding")) {
} else if (key.equals("content-encoding")) {
// This is kindof a hack, but if we are downloading a gzip file
// we don't want to transparently gunzip it and save it as a .gz file.
// A query string will also mess this up
if ((!_actualURL.endsWith(".gz")) && (!_actualURL.endsWith(".tgz")))
_isGzippedResponse = val.toLowerCase(Locale.US).contains("gzip");
} else if (key.equalsIgnoreCase("Content-Type")) {
} else if (key.equals("content-type")) {
_contentType=val;
} else if (key.equalsIgnoreCase("Location")) {
} else if (key.equals("location")) {
_redirectLocation=val;
} else {
// ignore the rest