summaryrefslogtreecommitdiffstats
path: root/net/test
diff options
context:
space:
mode:
authoryfriedman@chromium.org <yfriedman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-15 19:24:17 +0000
committeryfriedman@chromium.org <yfriedman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-15 19:24:17 +0000
commitf13187d0c386be484d2e84abb3d0d31e157cd83d (patch)
tree20ca8d4e740ccd5da0f4e8674c72d00c0b504a26 /net/test
parent9aec60629ceb5924528606a851b157d0cc9f0e76 (diff)
downloadchromium_src-f13187d0c386be484d2e84abb3d0d31e157cd83d.zip
chromium_src-f13187d0c386be484d2e84abb3d0d31e157cd83d.tar.gz
chromium_src-f13187d0c386be484d2e84abb3d0d31e157cd83d.tar.bz2
Fix several findbugs issues
This addresses the following classes of findbugs issues: - ST, MS, SS, DLS, SIC Also sprinkled in are eclipse auto-corrects of final, @Override and import fixes. NOTRY=true Review URL: https://chromiumcodereview.appspot.com/12545043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188447 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/test')
-rw-r--r--net/test/android/javatests/src/org/chromium/net/test/util/TestWebServer.java21
1 files changed, 12 insertions, 9 deletions
diff --git a/net/test/android/javatests/src/org/chromium/net/test/util/TestWebServer.java b/net/test/android/javatests/src/org/chromium/net/test/util/TestWebServer.java
index c892afe..9e60a43 100644
--- a/net/test/android/javatests/src/org/chromium/net/test/util/TestWebServer.java
+++ b/net/test/android/javatests/src/org/chromium/net/test/util/TestWebServer.java
@@ -70,9 +70,9 @@ public class TestWebServer {
private static TestWebServer sInstance;
private static Hashtable<Integer, String> sReasons;
- private ServerThread mServerThread;
+ private final ServerThread mServerThread;
private String mServerUri;
- private boolean mSsl;
+ private final boolean mSsl;
private static class Response {
final byte[] mResponseData;
@@ -91,9 +91,9 @@ public class TestWebServer {
// The Maps below are modified on both the client thread and the internal server thread, so
// need to use a lock when accessing them.
private final Object mLock = new Object();
- private Map<String, Response> mResponseMap = new HashMap<String, Response>();
- private Map<String, Integer> mResponseCountMap = new HashMap<String, Integer>();
- private Map<String, HttpRequest> mLastRequestMap = new HashMap<String, HttpRequest>();
+ private final Map<String, Response> mResponseMap = new HashMap<String, Response>();
+ private final Map<String, Integer> mResponseCountMap = new HashMap<String, Integer>();
+ private final Map<String, HttpRequest> mLastRequestMap = new HashMap<String, HttpRequest>();
/**
* Create and start a local HTTP server instance.
@@ -106,7 +106,7 @@ public class TestWebServer {
// shut down the old instance first
sInstance.shutdown();
}
- sInstance = this;
+ setStaticInstance(this);
mSsl = ssl;
if (mSsl) {
mServerUri = "https://localhost:" + SSL_SERVER_PORT;
@@ -117,6 +117,10 @@ public class TestWebServer {
mServerThread.start();
}
+ private static void setStaticInstance(TestWebServer instance) {
+ sInstance = instance;
+ }
+
/**
* Terminate the http server.
*/
@@ -149,7 +153,7 @@ public class TestWebServer {
throw new IllegalStateException(e);
}
- TestWebServer.sInstance = null;
+ setStaticInstance(null);
}
private final static int RESPONSE_STATUS_NORMAL = 0;
@@ -369,7 +373,6 @@ public class TestWebServer {
}
private void setDateHeaders(HttpResponse response) {
- long time = System.currentTimeMillis();
response.addHeader("Date", DateUtils.formatDate(new Date(), DateUtils.PATTERN_RFC1123));
}
@@ -451,7 +454,7 @@ public class TestWebServer {
"1gaEjsC/0wGmmBDg1dTDH+F1p9TInzr3EFuYD0YiQ7YlAHq3cPuyGoLXJ5dXYuSBfhDXJSeddUkl" +
"k1ufZyOOcskeInQge7jzaRfmKg3U94r+spMEvb0AzDQVOKvjjo1ivxMSgFRZaDb/4qw=";
- private String PASSWORD = "android";
+ private static final String PASSWORD = "android";
/**
* Loads a keystore from a base64-encoded String. Returns the KeyManager[]