From fd8fa32db1a99ac54b50e6cb0a7b63efb4932f4c Mon Sep 17 00:00:00 2001 From: Edwin Kempin Date: Wed, 14 Jun 2017 09:38:58 +0200 Subject: [PATCH] Remove more finals from method signatures Change-Id: I5849ebf378469dcfd5b89bed88c6f7dedf67f7ba Signed-off-by: Edwin Kempin --- .../httpd/auth/openid/OpenIdServiceImpl.java | 16 +++++++-------- .../gerrit/pgm/http/jetty/JettyServer.java | 2 +- .../pgm/http/jetty/ProjectQoSFilter.java | 8 ++++---- .../com/google/gerrit/pgm/init/Browser.java | 2 +- .../server/GerritPersonIdentProvider.java | 2 +- .../gerrit/server/auth/ldap/Helper.java | 2 +- .../gerrit/server/auth/ldap/LdapRealm.java | 8 +++----- .../config/AnonymousCowardNameProvider.java | 2 +- .../gerrit/server/config/AuthConfig.java | 2 +- .../config/CanonicalWebUrlProvider.java | 2 +- .../gerrit/server/config/DownloadConfig.java | 2 +- .../server/config/EmailExpanderProvider.java | 2 +- .../config/TrackingFootersProvider.java | 2 +- .../send/FromAddressGeneratorProvider.java | 9 ++++----- .../server/mail/send/SmtpEmailSender.java | 2 +- .../com/google/gerrit/server/schema/DB2.java | 2 +- .../com/google/gerrit/server/schema/H2.java | 2 +- .../com/google/gerrit/server/schema/HANA.java | 2 +- .../com/google/gerrit/server/schema/JDBC.java | 2 +- .../google/gerrit/server/schema/MaxDb.java | 2 +- .../google/gerrit/server/schema/MySql.java | 2 +- .../google/gerrit/server/schema/Oracle.java | 2 +- .../gerrit/server/schema/PostgreSQL.java | 2 +- .../gerrit/sshd/CommandFactoryProvider.java | 10 +++++----- .../gerrit/sshd/DatabasePubKeyAuth.java | 18 ++++++++--------- .../com/google/gerrit/sshd/SshDaemon.java | 20 +++++++++---------- .../sshd/StreamCommandExecutorProvider.java | 2 +- 27 files changed, 63 insertions(+), 66 deletions(-) diff --git a/gerrit-openid/src/main/java/com/google/gerrit/httpd/auth/openid/OpenIdServiceImpl.java b/gerrit-openid/src/main/java/com/google/gerrit/httpd/auth/openid/OpenIdServiceImpl.java index bd2efdf42f..86ed398196 100644 --- a/gerrit-openid/src/main/java/com/google/gerrit/httpd/auth/openid/OpenIdServiceImpl.java +++ b/gerrit-openid/src/main/java/com/google/gerrit/httpd/auth/openid/OpenIdServiceImpl.java @@ -99,12 +99,12 @@ class OpenIdServiceImpl { @Inject OpenIdServiceImpl( - final DynamicItem cf, - final Provider iu, + DynamicItem cf, + Provider iu, CanonicalWebUrl up, - @GerritServerConfig final Config config, - final AuthConfig ac, - final AccountManager am, + @GerritServerConfig Config config, + AuthConfig ac, + AccountManager am, ProxyProperties proxyProperties) { if (proxyProperties.getProxyUrl() != null) { @@ -139,9 +139,9 @@ class OpenIdServiceImpl { DiscoveryResult discover( HttpServletRequest req, String openidIdentifier, - final SignInMode mode, - final boolean remember, - final String returnToken) { + SignInMode mode, + boolean remember, + String returnToken) { final State state; state = init(req, openidIdentifier, mode, remember, returnToken); if (state == null) { diff --git a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/http/jetty/JettyServer.java b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/http/jetty/JettyServer.java index 6b6ffe991f..79bc224607 100644 --- a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/http/jetty/JettyServer.java +++ b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/http/jetty/JettyServer.java @@ -79,7 +79,7 @@ public class JettyServer { private final Config cfg; @Inject - Lifecycle(JettyServer server, @GerritServerConfig final Config cfg) { + Lifecycle(JettyServer server, @GerritServerConfig Config cfg) { this.server = server; this.cfg = cfg; } diff --git a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/http/jetty/ProjectQoSFilter.java b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/http/jetty/ProjectQoSFilter.java index 82238d63b3..66b969a8c9 100644 --- a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/http/jetty/ProjectQoSFilter.java +++ b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/http/jetty/ProjectQoSFilter.java @@ -85,10 +85,10 @@ public class ProjectQoSFilter implements Filter { @Inject ProjectQoSFilter( - final Provider user, + Provider user, QueueProvider queue, - final ServletContext context, - @GerritServerConfig final Config cfg) { + ServletContext context, + @GerritServerConfig Config cfg) { this.user = user; this.queue = queue; this.context = context; @@ -155,7 +155,7 @@ public class ProjectQoSFilter implements Filter { private boolean done; private Thread worker; - TaskThunk(final WorkQueue.Executor executor, Continuation cont, HttpServletRequest req) { + TaskThunk(WorkQueue.Executor executor, Continuation cont, HttpServletRequest req) { this.executor = executor; this.cont = cont; this.name = generateName(req); diff --git a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/Browser.java b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/Browser.java index 27620fa50a..2e49e13bf0 100644 --- a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/Browser.java +++ b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/Browser.java @@ -29,7 +29,7 @@ public class Browser { private final Config cfg; @Inject - Browser(@GerritServerConfig final Config cfg) { + Browser(@GerritServerConfig Config cfg) { this.cfg = cfg; } diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/GerritPersonIdentProvider.java b/gerrit-server/src/main/java/com/google/gerrit/server/GerritPersonIdentProvider.java index 8c68270ba4..87ba55a2e6 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/GerritPersonIdentProvider.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/GerritPersonIdentProvider.java @@ -29,7 +29,7 @@ public class GerritPersonIdentProvider implements Provider { private final String email; @Inject - public GerritPersonIdentProvider(@GerritServerConfig final Config cfg) { + public GerritPersonIdentProvider(@GerritServerConfig Config cfg) { String name = cfg.getString("user", null, "name"); if (name == null) { name = "Gerrit Code Review"; diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/auth/ldap/Helper.java b/gerrit-server/src/main/java/com/google/gerrit/server/auth/ldap/Helper.java index d0a1285a06..20a2be6f91 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/auth/ldap/Helper.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/auth/ldap/Helper.java @@ -73,7 +73,7 @@ class Helper { @Inject Helper( - @GerritServerConfig final Config config, + @GerritServerConfig Config config, @Named(LdapModule.PARENT_GROUPS_CACHE) Cache> parentGroups) { this.config = config; this.server = LdapRealm.optional(config, "server"); diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/auth/ldap/LdapRealm.java b/gerrit-server/src/main/java/com/google/gerrit/server/auth/ldap/LdapRealm.java index 50df3e8ecc..a34e3fcadb 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/auth/ldap/LdapRealm.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/auth/ldap/LdapRealm.java @@ -81,11 +81,9 @@ class LdapRealm extends AbstractRealm { AuthConfig authConfig, EmailExpander emailExpander, LdapGroupBackend groupBackend, - @Named(LdapModule.GROUP_CACHE) - final LoadingCache> membershipCache, - @Named(LdapModule.USERNAME_CACHE) - final LoadingCache> usernameCache, - @GerritServerConfig final Config config) { + @Named(LdapModule.GROUP_CACHE) LoadingCache> membershipCache, + @Named(LdapModule.USERNAME_CACHE) LoadingCache> usernameCache, + @GerritServerConfig Config config) { this.helper = helper; this.authConfig = authConfig; this.emailExpander = emailExpander; diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/config/AnonymousCowardNameProvider.java b/gerrit-server/src/main/java/com/google/gerrit/server/config/AnonymousCowardNameProvider.java index 3f3d6fd269..79676f67a4 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/config/AnonymousCowardNameProvider.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/config/AnonymousCowardNameProvider.java @@ -24,7 +24,7 @@ public class AnonymousCowardNameProvider implements Provider { private final String anonymousCoward; @Inject - public AnonymousCowardNameProvider(@GerritServerConfig final Config cfg) { + public AnonymousCowardNameProvider(@GerritServerConfig Config cfg) { String anonymousCoward = cfg.getString("user", null, "anonymousCoward"); if (anonymousCoward == null) { anonymousCoward = DEFAULT; diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/config/AuthConfig.java b/gerrit-server/src/main/java/com/google/gerrit/server/config/AuthConfig.java index 6540e5b94c..d5c2439d23 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/config/AuthConfig.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/config/AuthConfig.java @@ -67,7 +67,7 @@ public class AuthConfig { private GitBasicAuthPolicy gitBasicAuthPolicy; @Inject - AuthConfig(@GerritServerConfig final Config cfg) throws XsrfException { + AuthConfig(@GerritServerConfig Config cfg) throws XsrfException { authType = toType(cfg); httpHeader = cfg.getString("auth", null, "httpheader"); httpDisplaynameHeader = cfg.getString("auth", null, "httpdisplaynameheader"); diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/config/CanonicalWebUrlProvider.java b/gerrit-server/src/main/java/com/google/gerrit/server/config/CanonicalWebUrlProvider.java index e670e2cdc5..539951f237 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/config/CanonicalWebUrlProvider.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/config/CanonicalWebUrlProvider.java @@ -23,7 +23,7 @@ public class CanonicalWebUrlProvider implements Provider { private final String canonicalUrl; @Inject - public CanonicalWebUrlProvider(@GerritServerConfig final Config config) { + public CanonicalWebUrlProvider(@GerritServerConfig Config config) { String u = config.getString("gerrit", null, "canonicalweburl"); if (u != null && !u.endsWith("/")) { u += "/"; diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/config/DownloadConfig.java b/gerrit-server/src/main/java/com/google/gerrit/server/config/DownloadConfig.java index 48d4507d61..e9d5e5e83e 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/config/DownloadConfig.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/config/DownloadConfig.java @@ -40,7 +40,7 @@ public class DownloadConfig { private final ImmutableSet archiveFormats; @Inject - DownloadConfig(@GerritServerConfig final Config cfg) { + DownloadConfig(@GerritServerConfig Config cfg) { String[] allSchemes = cfg.getStringList("download", null, "scheme"); if (allSchemes.length == 0) { downloadSchemes = diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/config/EmailExpanderProvider.java b/gerrit-server/src/main/java/com/google/gerrit/server/config/EmailExpanderProvider.java index 1c42c09a47..734bf03473 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/config/EmailExpanderProvider.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/config/EmailExpanderProvider.java @@ -23,7 +23,7 @@ class EmailExpanderProvider implements Provider { private final EmailExpander expander; @Inject - EmailExpanderProvider(@GerritServerConfig final Config cfg) { + EmailExpanderProvider(@GerritServerConfig Config cfg) { final String s = cfg.getString("auth", null, "emailformat"); if (EmailExpander.Simple.canHandle(s)) { expander = new EmailExpander.Simple(s); diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/config/TrackingFootersProvider.java b/gerrit-server/src/main/java/com/google/gerrit/server/config/TrackingFootersProvider.java index 5389b1f9f6..2b1af3619f 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/config/TrackingFootersProvider.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/config/TrackingFootersProvider.java @@ -40,7 +40,7 @@ public class TrackingFootersProvider implements Provider { private static final Logger log = LoggerFactory.getLogger(TrackingFootersProvider.class); @Inject - TrackingFootersProvider(@GerritServerConfig final Config cfg) { + TrackingFootersProvider(@GerritServerConfig Config cfg) { for (String name : cfg.getSubsections(TRACKING_ID_TAG)) { boolean configValid = true; diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/mail/send/FromAddressGeneratorProvider.java b/gerrit-server/src/main/java/com/google/gerrit/server/mail/send/FromAddressGeneratorProvider.java index 53fcc7fe6f..c2c6834692 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/mail/send/FromAddressGeneratorProvider.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/mail/send/FromAddressGeneratorProvider.java @@ -41,11 +41,10 @@ public class FromAddressGeneratorProvider implements Provider, LifecycleListe @Inject CommandFactoryProvider( - @CommandName(Commands.ROOT) final DispatchCommandProvider d, - @GerritServerConfig final Config cfg, - final WorkQueue workQueue, - final SshLog l, - final SshScope s, + @CommandName(Commands.ROOT) DispatchCommandProvider d, + @GerritServerConfig Config cfg, + WorkQueue workQueue, + SshLog l, + SshScope s, SchemaFactory sf) { dispatcher = d; log = l; diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/DatabasePubKeyAuth.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/DatabasePubKeyAuth.java index 9ea7b65d14..7e0406adf9 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/DatabasePubKeyAuth.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/DatabasePubKeyAuth.java @@ -62,14 +62,14 @@ class DatabasePubKeyAuth implements PublickeyAuthenticator { @Inject DatabasePubKeyAuth( - final SshKeyCacheImpl skc, - final SshLog l, - final IdentifiedUser.GenericFactory uf, - final PeerDaemonUser.Factory pf, - final SitePaths site, - final KeyPairProvider hostKeyProvider, - @GerritServerConfig final Config cfg, - final SshScope s) { + SshKeyCacheImpl skc, + SshLog l, + IdentifiedUser.GenericFactory uf, + PeerDaemonUser.Factory pf, + SitePaths site, + KeyPairProvider hostKeyProvider, + @GerritServerConfig Config cfg, + SshScope s) { sshKeyCache = skc; sshLog = l; userFactory = uf; @@ -162,7 +162,7 @@ class DatabasePubKeyAuth implements PublickeyAuthenticator { return p.keys; } - private SshKeyCacheEntry find(final Iterable keyList, PublicKey suppliedKey) { + private SshKeyCacheEntry find(Iterable keyList, PublicKey suppliedKey) { for (SshKeyCacheEntry k : keyList) { if (k.match(suppliedKey)) { return k; diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/SshDaemon.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/SshDaemon.java index 22791674b7..4b37dad0b3 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/SshDaemon.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/SshDaemon.java @@ -149,16 +149,16 @@ public class SshDaemon extends SshServer implements SshInfo, LifecycleListener { @Inject SshDaemon( - final CommandFactory commandFactory, - final NoShell noShell, - final PublickeyAuthenticator userAuth, - final GerritGSSAuthenticator kerberosAuth, - final KeyPairProvider hostKeyProvider, - final IdGenerator idGenerator, - @GerritServerConfig final Config cfg, - final SshLog sshLog, - @SshListenAddresses final List listen, - @SshAdvertisedAddresses final List advertised, + CommandFactory commandFactory, + NoShell noShell, + PublickeyAuthenticator userAuth, + GerritGSSAuthenticator kerberosAuth, + KeyPairProvider hostKeyProvider, + IdGenerator idGenerator, + @GerritServerConfig Config cfg, + SshLog sshLog, + @SshListenAddresses List listen, + @SshAdvertisedAddresses List advertised, MetricMaker metricMaker) { setPort(IANA_SSH_PORT /* never used */); diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/StreamCommandExecutorProvider.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/StreamCommandExecutorProvider.java index 76612100e7..8c351823e2 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/StreamCommandExecutorProvider.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/StreamCommandExecutorProvider.java @@ -26,7 +26,7 @@ class StreamCommandExecutorProvider implements Provider { private final WorkQueue queues; @Inject - StreamCommandExecutorProvider(@GerritServerConfig final Config config, WorkQueue wq) { + StreamCommandExecutorProvider(@GerritServerConfig Config config, WorkQueue wq) { final int cores = Runtime.getRuntime().availableProcessors(); poolSize = config.getInt("sshd", "streamThreads", cores + 1); queues = wq;