Remove redundant specification of type arguments Change-Id: I84e81d4ea9b4bcb3d64010814e3dcded3973aee4
diff --git a/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/AuthenticatedHttpRequest.java b/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/AuthenticatedHttpRequest.java index d13ba3f..3cfa11f 100644 --- a/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/AuthenticatedHttpRequest.java +++ b/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/AuthenticatedHttpRequest.java
@@ -23,7 +23,7 @@ import javax.servlet.http.HttpServletRequestWrapper; public class AuthenticatedHttpRequest extends HttpServletRequestWrapper { - private HashMap<String, String> headers = new HashMap<String, String>(); + private HashMap<String, String> headers = new HashMap<>(); public AuthenticatedHttpRequest(HttpServletRequest request, String... headerNamesValues) { @@ -41,7 +41,7 @@ @Override public Enumeration<String> getHeaderNames() { final Enumeration<String> wrappedHeaderNames = super.getHeaderNames(); - HashSet<String> headerNames = new HashSet<String>(headers.keySet()); + HashSet<String> headerNames = new HashSet<>(headers.keySet()); while (wrappedHeaderNames.hasMoreElements()) { headerNames.add(wrappedHeaderNames.nextElement()); }
diff --git a/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubLogin.java b/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubLogin.java index 8cc52ae..6e050b4 100644 --- a/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubLogin.java +++ b/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubLogin.java
@@ -181,10 +181,10 @@ } private SortedSet<Scope> getScopes(String baseScopeKey, Scope... scopes) { - HashSet<Scope> fullScopes = new HashSet<Scope>(scopesForKey(baseScopeKey)); + HashSet<Scope> fullScopes = new HashSet<>(scopesForKey(baseScopeKey)); fullScopes.addAll(Arrays.asList(scopes)); - return new TreeSet<Scope>(fullScopes); + return new TreeSet<>(fullScopes); } private List<Scope> scopesForKey(String baseScopeKey) {
diff --git a/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubOAuthConfig.java b/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubOAuthConfig.java index e2ea0f8..7a7e621 100644 --- a/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubOAuthConfig.java +++ b/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubOAuthConfig.java
@@ -137,7 +137,7 @@ } private List<Scope> parseScopesString(String scopesString) { - ArrayList<Scope> scopes = new ArrayList<OAuthProtocol.Scope>(); + ArrayList<Scope> scopes = new ArrayList<>(); if (Strings.emptyToNull(scopesString) != null) { String[] scopesStrings = scopesString.split(","); for (String scope : scopesStrings) {
diff --git a/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/OAuthGitFilter.java b/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/OAuthGitFilter.java index c0f3897..4cc8f4f 100644 --- a/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/OAuthGitFilter.java +++ b/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/OAuthGitFilter.java
@@ -75,7 +75,7 @@ private ScopedProvider<GitHubLogin> ghLoginProvider; public static class BasicAuthHttpRequest extends HttpServletRequestWrapper { - private HashMap<String, String> headers = new HashMap<String, String>(); + private HashMap<String, String> headers = new HashMap<>(); public BasicAuthHttpRequest(HttpServletRequest request, String username, String password) { @@ -96,7 +96,7 @@ @Override public Enumeration<String> getHeaderNames() { final Enumeration<String> wrappedHeaderNames = super.getHeaderNames(); - HashSet<String> headerNames = new HashSet<String>(headers.keySet()); + HashSet<String> headerNames = new HashSet<>(headers.keySet()); while (wrappedHeaderNames.hasMoreElements()) { headerNames.add(wrappedHeaderNames.nextElement()); }
diff --git a/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/OAuthProtocol.java b/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/OAuthProtocol.java index a349c42..7b12c61 100644 --- a/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/OAuthProtocol.java +++ b/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/OAuthProtocol.java
@@ -364,7 +364,7 @@ public AccessToken getAccessToken(OAuthVerifier code) throws IOException { HttpPost post = new HttpPost(config.gitHubOAuthAccessTokenUrl); post.setHeader("Accept", "application/json"); - List<NameValuePair> nvps = new ArrayList<NameValuePair>(); + List<NameValuePair> nvps = new ArrayList<>(); nvps.add(new BasicNameValuePair("client_id", config.gitHubClientId)); nvps.add(new BasicNameValuePair("client_secret", config.gitHubClientSecret)); nvps.add(new BasicNameValuePair("code", code.getValue()));
diff --git a/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/git/BatchImporter.java b/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/git/BatchImporter.java index 92cd9c9..b2bc91d 100644 --- a/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/git/BatchImporter.java +++ b/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/git/BatchImporter.java
@@ -20,7 +20,7 @@ public class BatchImporter { - private final ConcurrentHashMap<Integer, GitJob> jobs = new ConcurrentHashMap<Integer, GitJob>(); + private final ConcurrentHashMap<Integer, GitJob> jobs = new ConcurrentHashMap<>(); private final JobExecutor executor; protected final IdentifiedUser user;
diff --git a/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/git/ReplicationConfig.java b/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/git/ReplicationConfig.java index 0296ce6..103d43e 100644 --- a/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/git/ReplicationConfig.java +++ b/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/git/ReplicationConfig.java
@@ -53,7 +53,7 @@ replicationConf.load(); replicationConf.setString("remote", username, "url", url); List<String> projects = - new ArrayList<String>(Arrays.asList(replicationConf.getStringList( + new ArrayList<>(Arrays.asList(replicationConf.getStringList( "remote", username, "projects"))); projects.add(projectName); replicationConf.setStringList("remote", username, "projects", projects);
diff --git a/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/group/GitHubGroupBackend.java b/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/group/GitHubGroupBackend.java index 00181b8..8353cce 100644 --- a/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/group/GitHubGroupBackend.java +++ b/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/group/GitHubGroupBackend.java
@@ -98,7 +98,7 @@ log.debug("Full list of user's organisations: {}", ghOrgs); Builder<GroupReference> orgGroups = - new ImmutableSet.Builder<GroupReference>(); + new ImmutableSet.Builder<>(); for (String organizationName : ghOrgs) { if (organizationName.toLowerCase().startsWith(orgNamePrefixLowercase)) { GroupReference teamGroupRef =
diff --git a/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/replication/GitHubDestinations.java b/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/replication/GitHubDestinations.java index ab8fa24..83352a4 100644 --- a/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/replication/GitHubDestinations.java +++ b/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/replication/GitHubDestinations.java
@@ -85,7 +85,7 @@ } private List<String> getOrganisations(List<Destination> destinations) { - ArrayList<String> organisations = new ArrayList<String>(); + ArrayList<String> organisations = new ArrayList<>(); for (Destination destination : destinations) { for (URIish urish : destination.getRemote().getURIs()) { String[] uriPathParts = urish.getPath().split("/");