diff options
author | Han-Wen Nienhuys <hanwen@google.com> | 2018-05-16 16:34:16 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2018-05-18 17:59:45 +0200 |
commit | f3ec7cf3f0436a79e252251a31dbc62694555897 (patch) | |
tree | 49a647fa520bb5a1016425df26357947f8dab95c /org.eclipse.jgit.http.server | |
parent | 667e30678a6bad26f4d4d412e996b293e52e5b87 (diff) | |
download | jgit-f3ec7cf3f0436a79e252251a31dbc62694555897.tar.gz jgit-f3ec7cf3f0436a79e252251a31dbc62694555897.zip |
Remove further unnecessary 'final' keywords
Remove it from
* package private functions.
* try blocks
* for loops
this was done with the following python script:
$ cat f.py
import sys
import re
import os
def replaceFinal(m):
return m.group(1) + "(" + m.group(2).replace('final ', '') + ")"
methodDecl = re.compile(r"^([\t ]*[a-zA-Z_ ]+)\(([^)]*)\)")
def subst(fn):
input = open(fn)
os.rename(fn, fn + "~")
dest = open(fn, 'w')
for l in input:
l = methodDecl.sub(replaceFinal, l)
dest.write(l)
dest.close()
for root, dirs, files in os.walk(".", topdown=False):
for f in files:
if not f.endswith('.java'):
continue
full = os.path.join(root, f)
print full
subst(full)
Change-Id: If533a75a417594fc893e7c669d2c1f0f6caeb7ca
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Diffstat (limited to 'org.eclipse.jgit.http.server')
12 files changed, 20 insertions, 20 deletions
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/AsIsFileFilter.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/AsIsFileFilter.java index 7f826d4f27..9e9f25e611 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/AsIsFileFilter.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/AsIsFileFilter.java @@ -66,7 +66,7 @@ import org.eclipse.jgit.transport.resolver.ServiceNotEnabledException; class AsIsFileFilter implements Filter { private final AsIsFileService asIs; - AsIsFileFilter(final AsIsFileService getAnyFile) { + AsIsFileFilter(AsIsFileService getAnyFile) { this.asIs = getAnyFile; } diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/FileSender.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/FileSender.java index 09f110d9b3..05510a05b0 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/FileSender.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/FileSender.java @@ -84,7 +84,7 @@ final class FileSender { private long end; - FileSender(final File path) throws FileNotFoundException { + FileSender(File path) throws FileNotFoundException { this.path = path; this.source = new RandomAccessFile(path, "r"); diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ObjectFileServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ObjectFileServlet.java index 1c523a0623..62f075c73c 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ObjectFileServlet.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ObjectFileServlet.java @@ -75,7 +75,7 @@ abstract class ObjectFileServlet extends HttpServlet { } @Override - String etag(final FileSender sender) throws IOException { + String etag(FileSender sender) throws IOException { return Long.toHexString(sender.getLastModified()); } } @@ -88,7 +88,7 @@ abstract class ObjectFileServlet extends HttpServlet { } @Override - String etag(final FileSender sender) throws IOException { + String etag(FileSender sender) throws IOException { return sender.getTailChecksum(); } } @@ -111,7 +111,7 @@ abstract class ObjectFileServlet extends HttpServlet { private final String contentType; - ObjectFileServlet(final String contentType) { + ObjectFileServlet(String contentType) { this.contentType = contentType; } diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ServletUtils.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ServletUtils.java index 2ff385dbec..9601c8cafa 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ServletUtils.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ServletUtils.java @@ -238,7 +238,7 @@ public final class ServletUtils { return content; } - static boolean acceptsGzipEncoding(final HttpServletRequest req) { + static boolean acceptsGzipEncoding(HttpServletRequest req) { return acceptsGzipEncoding(req.getHeader(HDR_ACCEPT_ENCODING)); } diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartServiceInfoRefs.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartServiceInfoRefs.java index 6417877e1b..92009c5731 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartServiceInfoRefs.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartServiceInfoRefs.java @@ -75,7 +75,7 @@ abstract class SmartServiceInfoRefs implements Filter { private final Filter[] filters; - SmartServiceInfoRefs(final String service, final List<Filter> filters) { + SmartServiceInfoRefs(String service, List<Filter> filters) { this.svc = service; this.filters = filters.toArray(new Filter[filters.size()]); } diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/TextFileServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/TextFileServlet.java index 5cac868b9f..b2466d0e3e 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/TextFileServlet.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/TextFileServlet.java @@ -64,7 +64,7 @@ class TextFileServlet extends HttpServlet { private final String fileName; - TextFileServlet(final String name) { + TextFileServlet(String name) { this.fileName = name; } diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/RegexPipeline.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/RegexPipeline.java index bf2d6dbb4d..010810508a 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/RegexPipeline.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/RegexPipeline.java @@ -87,11 +87,11 @@ class RegexPipeline extends UrlPipeline { static class Binder extends ServletBinderImpl { private final Pattern pattern; - Binder(final String p) { + Binder(String p) { pattern = Pattern.compile(p); } - Binder(final Pattern p) { + Binder(Pattern p) { pattern = p; } @@ -110,7 +110,7 @@ class RegexPipeline extends UrlPipeline { } @Override - boolean match(final HttpServletRequest req) { + boolean match(HttpServletRequest req) { final String pathInfo = req.getPathInfo(); return pathInfo != null && pattern.matcher(pathInfo).matches(); } diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/SuffixPipeline.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/SuffixPipeline.java index 6742c9f721..4fd99c6ef3 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/SuffixPipeline.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/SuffixPipeline.java @@ -67,7 +67,7 @@ class SuffixPipeline extends UrlPipeline { static class Binder extends ServletBinderImpl { private final String suffix; - Binder(final String suffix) { + Binder(String suffix) { this.suffix = suffix; } @@ -89,7 +89,7 @@ class SuffixPipeline extends UrlPipeline { } @Override - boolean match(final HttpServletRequest req) { + boolean match(HttpServletRequest req) { final String pathInfo = req.getPathInfo(); return pathInfo != null && pathInfo.endsWith(suffix); } diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/UrlPipeline.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/UrlPipeline.java index 56e4e22889..c02399a23f 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/UrlPipeline.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/UrlPipeline.java @@ -79,7 +79,7 @@ abstract class UrlPipeline { /** Instance that must generate the response; never null. */ private final HttpServlet servlet; - UrlPipeline(final Filter[] filters, final HttpServlet servlet) { + UrlPipeline(Filter[] filters, HttpServlet servlet) { this.filters = filters; this.servlet = servlet; } @@ -99,7 +99,7 @@ abstract class UrlPipeline { * @throws ServletException * a filter or servlet is unable to initialize. */ - void init(final ServletContext context, final Set<Object> inited) + void init(ServletContext context, Set<Object> inited) throws ServletException { for (Filter ref : filters) initFilter(ref, context, inited); @@ -165,7 +165,7 @@ abstract class UrlPipeline { * destroyed a second time. Filters and servlets that are first * destroyed by this pipeline will be added to this set. */ - void destroy(final Set<Object> destroyed) { + void destroy(Set<Object> destroyed) { for (Filter ref : filters) destroyFilter(ref, destroyed); destroyServlet(servlet, destroyed); @@ -230,7 +230,7 @@ abstract class UrlPipeline { private int filterIdx; - Chain(final Filter[] filters, final HttpServlet servlet) { + Chain(Filter[] filters, HttpServlet servlet) { this.filters = filters; this.servlet = servlet; } diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/AsIsFileService.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/AsIsFileService.java index 11ad5e0e1a..9a928b1e20 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/AsIsFileService.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/AsIsFileService.java @@ -73,7 +73,7 @@ public class AsIsFileService { private static class ServiceConfig { final boolean enabled; - ServiceConfig(final Config cfg) { + ServiceConfig(Config cfg) { enabled = cfg.getBoolean("http", "getanyfile", true); } } diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultReceivePackFactory.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultReceivePackFactory.java index fbd155c0dc..06a8f5effe 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultReceivePackFactory.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultReceivePackFactory.java @@ -74,7 +74,7 @@ public class DefaultReceivePackFactory implements final boolean enabled; - ServiceConfig(final Config cfg) { + ServiceConfig(Config cfg) { set = cfg.getString("http", null, "receivepack") != null; enabled = cfg.getBoolean("http", "receivepack", false); } diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultUploadPackFactory.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultUploadPackFactory.java index e6df77b836..30edc15166 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultUploadPackFactory.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultUploadPackFactory.java @@ -64,7 +64,7 @@ public class DefaultUploadPackFactory implements private static class ServiceConfig { final boolean enabled; - ServiceConfig(final Config cfg) { + ServiceConfig(Config cfg) { enabled = cfg.getBoolean("http", "uploadpack", true); } } |