diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2017-02-20 13:17:27 +0900 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2017-02-20 22:47:23 +0100 |
commit | 3b4448637fbb9d74e0c9d44048ba76bb7c1214ce (patch) | |
tree | 85bbb116d5b0336cb365a3f5a4d6c074afe80cc6 /org.eclipse.jgit.junit.http/src/org/eclipse/jgit | |
parent | 43eb8511f5d8225c0b4e2f899db2126334e5facf (diff) | |
download | jgit-3b4448637fbb9d74e0c9d44048ba76bb7c1214ce.tar.gz jgit-3b4448637fbb9d74e0c9d44048ba76bb7c1214ce.zip |
Enable and fix warnings about redundant specification of type arguments
Since the introduction of generic type parameter inference in Java 7,
it's not necessary to explicitly specify the type of generic parameters.
Enable the warning in Eclipse, and fix all occurrences.
Change-Id: I9158caf1beca5e4980b6240ac401f3868520aad0
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.junit.http/src/org/eclipse/jgit')
6 files changed, 11 insertions, 11 deletions
diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AccessEvent.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AccessEvent.java index 6580ade8ea..6b7853d730 100644 --- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AccessEvent.java +++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AccessEvent.java @@ -76,7 +76,7 @@ public class AccessEvent { } private static Map<String, String> cloneHeaders(final Request req) { - Map<String, String> r = new TreeMap<String, String>(); + Map<String, String> r = new TreeMap<>(); Enumeration hn = req.getHeaderNames(); while (hn.hasMoreElements()) { String key = (String) hn.nextElement(); @@ -88,7 +88,7 @@ public class AccessEvent { } private static Map<String, String> cloneHeaders(final Response rsp) { - Map<String, String> r = new TreeMap<String, String>(); + Map<String, String> r = new TreeMap<>(); Enumeration<String> hn = rsp.getHttpFields().getFieldNames(); while (hn.hasMoreElements()) { String key = hn.nextElement(); diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java index 1575cb650c..e9480fa9ff 100644 --- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java +++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java @@ -262,7 +262,7 @@ public class AppServer { /** @return all requests since the server was started. */ public List<AccessEvent> getRequests() { - return new ArrayList<AccessEvent>(log.getEvents()); + return new ArrayList<>(log.getEvents()); } /** @@ -282,7 +282,7 @@ public class AppServer { * @return all requests which match the given path. */ public List<AccessEvent> getRequests(String path) { - ArrayList<AccessEvent> r = new ArrayList<AccessEvent>(); + ArrayList<AccessEvent> r = new ArrayList<>(); for (AccessEvent event : log.getEvents()) { if (event.getPath().equals(path)) { r.add(event); diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/HttpTestCase.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/HttpTestCase.java index 5db76eb7b9..1b94e02fa4 100644 --- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/HttpTestCase.java +++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/HttpTestCase.java @@ -88,7 +88,7 @@ public abstract class HttpTestCase extends LocalDiskRepositoryTestCase { protected TestRepository<Repository> createTestRepository() throws IOException { - return new TestRepository<Repository>(createBareRepository()); + return new TestRepository<>(createBareRepository()); } protected URIish toURIish(String path) throws URISyntaxException { @@ -120,12 +120,12 @@ public abstract class HttpTestCase extends LocalDiskRepositoryTestCase { protected static void fsck(Repository db, RevObject... tips) throws Exception { TestRepository<? extends Repository> tr = - new TestRepository<Repository>(db); + new TestRepository<>(db); tr.fsck(tips); } protected static Set<RefSpec> mirror(String... refs) { - HashSet<RefSpec> r = new HashSet<RefSpec>(); + HashSet<RefSpec> r = new HashSet<>(); for (String name : refs) { RefSpec rs = new RefSpec(name); rs = rs.setDestination(name); diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/MockServletConfig.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/MockServletConfig.java index 4f11ea8fca..9defcd9833 100644 --- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/MockServletConfig.java +++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/MockServletConfig.java @@ -52,7 +52,7 @@ import javax.servlet.ServletConfig; import javax.servlet.ServletContext; public class MockServletConfig implements ServletConfig { - private final Map<String, String> parameters = new HashMap<String, String>(); + private final Map<String, String> parameters = new HashMap<>(); public void setInitParameter(String name, String value) { parameters.put(name, value); diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/RecordingLogger.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/RecordingLogger.java index 5fed122637..f28ef893bb 100644 --- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/RecordingLogger.java +++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/RecordingLogger.java @@ -53,7 +53,7 @@ import org.slf4j.helpers.MessageFormatter; /** Logs warnings into an array for later inspection. */ public class RecordingLogger implements Logger { - private static List<Warning> warnings = new ArrayList<Warning>(); + private static List<Warning> warnings = new ArrayList<>(); /** Clear the warnings, automatically done by {@link AppServer#setUp()} */ public static void clear() { @@ -65,7 +65,7 @@ public class RecordingLogger implements Logger { /** @return the warnings (if any) from the last execution */ public static List<Warning> getWarnings() { synchronized (warnings) { - ArrayList<Warning> copy = new ArrayList<Warning>(warnings); + ArrayList<Warning> copy = new ArrayList<>(warnings); return Collections.unmodifiableList(copy); } } diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/TestRequestLog.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/TestRequestLog.java index 14ea03a921..c218c07a6c 100644 --- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/TestRequestLog.java +++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/TestRequestLog.java @@ -61,7 +61,7 @@ import org.eclipse.jetty.server.handler.HandlerWrapper; class TestRequestLog extends HandlerWrapper { private static final int MAX = 16; - private final List<AccessEvent> events = new ArrayList<AccessEvent>(); + private final List<AccessEvent> events = new ArrayList<>(); private final Semaphore active = new Semaphore(MAX); |