Remove superfluous final from gerrit/httpd/ Change-Id: I7f576ea09824944d33d6f422324d2337cc9bf4e5
diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/AllRequestFilter.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/AllRequestFilter.java index 09b6f25..e6918f70 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/AllRequestFilter.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/AllRequestFilter.java
@@ -97,7 +97,7 @@ } @Override - public void doFilter(ServletRequest req, ServletResponse res, final FilterChain last) + public void doFilter(ServletRequest req, ServletResponse res, FilterChain last) throws IOException, ServletException { final Iterator<AllRequestFilter> itr = filters.iterator(); new FilterChain() {
diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/CacheBasedWebSession.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/CacheBasedWebSession.java index f7309ec..9733d96 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/CacheBasedWebSession.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/CacheBasedWebSession.java
@@ -56,12 +56,12 @@ private CurrentUser user; protected CacheBasedWebSession( - final HttpServletRequest request, - final HttpServletResponse response, - final WebSessionManager manager, - final AuthConfig authConfig, - final Provider<AnonymousUser> anonymousProvider, - final IdentifiedUser.RequestFactory identified) { + HttpServletRequest request, + HttpServletResponse response, + WebSessionManager manager, + AuthConfig authConfig, + Provider<AnonymousUser> anonymousProvider, + IdentifiedUser.RequestFactory identified) { this.request = request; this.response = response; this.manager = manager; @@ -91,7 +91,7 @@ private String readCookie() { final Cookie[] all = request.getCookies(); if (all != null) { - for (final Cookie c : all) { + for (Cookie c : all) { if (ACCOUNT_COOKIE.equals(c.getName())) { final String v = c.getValue(); return v != null && !"".equals(v) ? v : null; @@ -229,7 +229,7 @@ response.addCookie(outCookie); } - private static boolean isSecure(final HttpServletRequest req) { + private static boolean isSecure(HttpServletRequest req) { return req.isSecure() || "https".equals(req.getScheme()); } }
diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/CookieBase64.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/CookieBase64.java index 11342be..14ef324 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/CookieBase64.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/CookieBase64.java
@@ -32,14 +32,14 @@ enc[o] = '.'; } - private static int fill(final char[] out, int o, final char f, final int l) { + private static int fill(char[] out, int o, char f, int l) { for (char c = f; c <= l; c++) { out[o++] = c; } return o; } - static String encode(final byte[] in) { + static String encode(byte[] in) { final StringBuilder out = new StringBuilder(in.length * 4 / 3); final int len2 = in.length - 2; int d = 0; @@ -53,7 +53,7 @@ } private static void encode3to4( - final StringBuilder out, final byte[] in, final int inOffset, final int numSigBytes) { + StringBuilder out, byte[] in, int inOffset, int numSigBytes) { // 1 2 3 // 01234567890123456789012345678901 Bit position // --------000000001111111122222222 Array position from threeBytes
diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/GetUserFilter.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/GetUserFilter.java index bbcd977..4282691 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/GetUserFilter.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/GetUserFilter.java
@@ -41,7 +41,7 @@ private final boolean enabled; @Inject - Module(@GerritServerConfig final Config cfg) { + Module(@GerritServerConfig Config cfg) { enabled = cfg.getBoolean("http", "addUserAsRequestAttribute", true); } @@ -56,7 +56,7 @@ private final Provider<CurrentUser> userProvider; @Inject - GetUserFilter(final Provider<CurrentUser> userProvider) { + GetUserFilter(Provider<CurrentUser> userProvider) { this.userProvider = userProvider; }
diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/HttpCanonicalWebUrlProvider.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/HttpCanonicalWebUrlProvider.java index 6411ee5..3dd31d9 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/HttpCanonicalWebUrlProvider.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/HttpCanonicalWebUrlProvider.java
@@ -28,12 +28,12 @@ private Provider<HttpServletRequest> requestProvider; @Inject - HttpCanonicalWebUrlProvider(@GerritServerConfig final Config config) { + HttpCanonicalWebUrlProvider(@GerritServerConfig Config config) { super(config); } @Inject(optional = true) - public void setHttpServletRequest(final Provider<HttpServletRequest> hsr) { + public void setHttpServletRequest(Provider<HttpServletRequest> hsr) { requestProvider = hsr; }
diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/HttpLogoutServlet.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/HttpLogoutServlet.java index 00c18af..5791367 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/HttpLogoutServlet.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/HttpLogoutServlet.java
@@ -42,17 +42,17 @@ @Inject protected HttpLogoutServlet( - final AuthConfig authConfig, - final DynamicItem<WebSession> webSession, - @CanonicalWebUrl @Nullable final Provider<String> urlProvider, - final AuditService audit) { + AuthConfig authConfig, + DynamicItem<WebSession> webSession, + @CanonicalWebUrl @Nullable Provider<String> urlProvider, + AuditService audit) { this.webSession = webSession; this.urlProvider = urlProvider; this.logoutUrl = authConfig.getLogoutURL(); this.audit = audit; } - protected void doLogout(final HttpServletRequest req, final HttpServletResponse rsp) + protected void doLogout(HttpServletRequest req, HttpServletResponse rsp) throws IOException { webSession.get().logout(); if (logoutUrl != null) { @@ -73,7 +73,7 @@ } @Override - protected void doGet(final HttpServletRequest req, final HttpServletResponse rsp) + protected void doGet(HttpServletRequest req, HttpServletResponse rsp) throws IOException { final String sid = webSession.get().getSessionId();
diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/HttpRemotePeerProvider.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/HttpRemotePeerProvider.java index 2dedd86..e023644 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/HttpRemotePeerProvider.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/HttpRemotePeerProvider.java
@@ -29,7 +29,7 @@ private final HttpServletRequest req; @Inject - HttpRemotePeerProvider(final HttpServletRequest r) { + HttpRemotePeerProvider(HttpServletRequest r) { req = r; }
diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/RequestContextFilter.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/RequestContextFilter.java index 548db48..c8cb2e6 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/RequestContextFilter.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/RequestContextFilter.java
@@ -48,9 +48,9 @@ @Inject RequestContextFilter( - final Provider<RequestCleanup> r, - final Provider<HttpRequestContext> c, - final ThreadLocalRequestContext l) { + Provider<RequestCleanup> r, + Provider<HttpRequestContext> c, + ThreadLocalRequestContext l) { cleanup = r; requestContext = c; local = l; @@ -64,7 +64,7 @@ @Override public void doFilter( - final ServletRequest request, final ServletResponse response, final FilterChain chain) + ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { RequestContext old = local.setContext(requestContext.get()); try {
diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/RequireSslFilter.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/RequireSslFilter.java index 4bdd1f0..1db2f84 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/RequireSslFilter.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/RequireSslFilter.java
@@ -52,7 +52,7 @@ private final Provider<String> urlProvider; @Inject - RequireSslFilter(@CanonicalWebUrl @Nullable final Provider<String> urlProvider) { + RequireSslFilter(@CanonicalWebUrl @Nullable Provider<String> urlProvider) { this.urlProvider = urlProvider; } @@ -64,7 +64,7 @@ @Override public void doFilter( - final ServletRequest request, final ServletResponse response, final FilterChain chain) + ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { final HttpServletRequest req = (HttpServletRequest) request; final HttpServletResponse rsp = (HttpServletResponse) response; @@ -91,11 +91,11 @@ } } - private static boolean isSecure(final HttpServletRequest req) { + private static boolean isSecure(HttpServletRequest req) { return "https".equals(req.getScheme()) || req.isSecure(); } - private static boolean isLocalHost(final HttpServletRequest req) { + private static boolean isLocalHost(HttpServletRequest req) { return "localhost".equals(req.getServerName()) || "127.0.0.1".equals(req.getServerName()); } }
diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/UrlModule.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/UrlModule.java index b6719e6..e270077 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/UrlModule.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/UrlModule.java
@@ -265,7 +265,7 @@ } static void toGerrit( - final String target, final HttpServletRequest req, final HttpServletResponse rsp) + String target, HttpServletRequest req, HttpServletResponse rsp) throws IOException { final StringBuilder url = new StringBuilder(); url.append(req.getContextPath());
diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/WebSessionManager.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/WebSessionManager.java index 7884089..8b6694c 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/WebSessionManager.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/WebSessionManager.java
@@ -55,7 +55,7 @@ private final Cache<String, Val> self; @Inject - WebSessionManager(@GerritServerConfig Config cfg, @Assisted final Cache<String, Val> cache) { + WebSessionManager(@GerritServerConfig Config cfg, @Assisted Cache<String, Val> cache) { prng = new SecureRandom(); self = cache; @@ -76,11 +76,11 @@ } } - Key createKey(final Account.Id who) { + Key createKey(Account.Id who) { return new Key(newUniqueToken(who)); } - private String newUniqueToken(final Account.Id who) { + private String newUniqueToken(Account.Id who) { try { final int nonceLen = 20; final ByteArrayOutputStream buf; @@ -135,7 +135,7 @@ return val; } - int getCookieAge(final Val val) { + int getCookieAge(Val val) { if (val.isPersistentCookie()) { // Client may store the cookie until we would remove it from our // own cache, after which it will certainly be invalid. @@ -150,7 +150,7 @@ return -1; } - Val get(final Key key) { + Val get(Key key) { Val val = self.getIfPresent(key.token); if (val != null && val.expiresAt <= nowMs()) { self.invalidate(key.token); @@ -159,14 +159,14 @@ return val; } - void destroy(final Key key) { + void destroy(Key key) { self.invalidate(key.token); } static final class Key { private transient String token; - Key(final String t) { + Key(String t) { token = t; } @@ -241,7 +241,7 @@ return persistentCookie; } - private void writeObject(final ObjectOutputStream out) throws IOException { + private void writeObject(ObjectOutputStream out) throws IOException { writeVarInt32(out, 1); writeVarInt32(out, accountId.get()); @@ -272,7 +272,7 @@ writeVarInt32(out, 0); } - private void readObject(final ObjectInputStream in) throws IOException { + private void readObject(ObjectInputStream in) throws IOException { PARSE: for (; ; ) { final int tag = readVarInt32(in);