[testng] 179/355: Use diamond operator in collections package
Eugene Zhukov
eugene-guest at moszumanska.debian.org
Tue Aug 18 10:20:02 UTC 2015
This is an automated email from the git hooks/post-receive script.
eugene-guest pushed a commit to annotated tag OpenBSD
in repository testng.
commit f3ae754eeb981d0a5986347d011d8b4cd5209e6e
Author: Julien Herr <julien.herr at alcatel-lucent.com>
Date: Mon Apr 13 10:59:43 2015 +0200
Use diamond operator in collections package
---
src/main/java/org/testng/collections/ListMultiMap.java | 2 +-
src/main/java/org/testng/collections/Lists.java | 8 ++++----
src/main/java/org/testng/collections/Maps.java | 12 ++++++------
src/main/java/org/testng/collections/Sets.java | 6 +++---
4 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/src/main/java/org/testng/collections/ListMultiMap.java b/src/main/java/org/testng/collections/ListMultiMap.java
index 71b5cdc..6781c9e 100644
--- a/src/main/java/org/testng/collections/ListMultiMap.java
+++ b/src/main/java/org/testng/collections/ListMultiMap.java
@@ -82,6 +82,6 @@ public class ListMultiMap<K, V> {
}
public static <K, V> ListMultiMap<K, V> create() {
- return new ListMultiMap<K, V>();
+ return new ListMultiMap<>();
}
}
diff --git a/src/main/java/org/testng/collections/Lists.java b/src/main/java/org/testng/collections/Lists.java
index 2b5eaec..b2ce5ba 100755
--- a/src/main/java/org/testng/collections/Lists.java
+++ b/src/main/java/org/testng/collections/Lists.java
@@ -8,20 +8,20 @@ import java.util.List;
public class Lists {
public static <K> List<K> newArrayList() {
- return new ArrayList<K>();
+ return new ArrayList<>();
}
public static <K> List<K> newArrayList(Collection<K> c) {
- return new ArrayList<K>(c);
+ return new ArrayList<>(c);
}
public static <K> List<K> newArrayList(K... elements) {
- List<K> result = new ArrayList<K>();
+ List<K> result = new ArrayList<>();
Collections.addAll(result, elements);
return result;
}
public static <K> List<K> newArrayList(int size) {
- return new ArrayList<K>(size);
+ return new ArrayList<>(size);
}
}
diff --git a/src/main/java/org/testng/collections/Maps.java b/src/main/java/org/testng/collections/Maps.java
index 2eaea02..692cfce 100755
--- a/src/main/java/org/testng/collections/Maps.java
+++ b/src/main/java/org/testng/collections/Maps.java
@@ -9,26 +9,26 @@ import java.util.Map;
public class Maps {
public static <K, V> Map<K,V> newHashMap() {
- return new HashMap<K, V>();
+ return new HashMap<>();
}
public static <K, V> Map<K,V> newHashtable() {
- return new Hashtable<K, V>();
+ return new Hashtable<>();
}
public static <K, V> ListMultiMap<K, V> newListMultiMap() {
- return new ListMultiMap<K, V>();
+ return new ListMultiMap<>();
}
public static <K, V> SetMultiMap<K, V> newSetMultiMap() {
- return new SetMultiMap<K, V>();
+ return new SetMultiMap<>();
}
public static <K, V> Map<K, V> newLinkedHashMap() {
- return new LinkedHashMap<K, V>();
+ return new LinkedHashMap<>();
}
public static <K, V> Map<K, V> newHashMap(Map<K, V> parameters) {
- return new HashMap<K, V>(parameters);
+ return new HashMap<>(parameters);
}
}
diff --git a/src/main/java/org/testng/collections/Sets.java b/src/main/java/org/testng/collections/Sets.java
index d6c3f07..68c01fe 100644
--- a/src/main/java/org/testng/collections/Sets.java
+++ b/src/main/java/org/testng/collections/Sets.java
@@ -8,14 +8,14 @@ import java.util.Set;
public class Sets {
public static <V> Set<V> newHashSet() {
- return new HashSet<V>();
+ return new HashSet<>();
}
public static <V> Set<V> newHashSet(Collection<V> c) {
- return new HashSet<V>(c);
+ return new HashSet<>(c);
}
public static <V> Set<V> newLinkedHashSet() {
- return new LinkedHashSet<V>();
+ return new LinkedHashSet<>();
}
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/testng.git
More information about the pkg-java-commits
mailing list