commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject [commons-collections] branch master updated: Remove redundant type arguments.
Date Sat, 09 Mar 2019 13:47:44 GMT
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-collections.git


The following commit(s) were added to refs/heads/master by this push:
     new 3b9f72b  Remove redundant type arguments.
3b9f72b is described below

commit 3b9f72be23c7f8c396af4c945a046a73c1ee0bd5
Author: Gary Gregory <gardgregory@gmail.com>
AuthorDate: Sat Mar 9 08:47:39 2019 -0500

    Remove redundant type arguments.
---
 .../apache/commons/collections4/CollectionUtils.java   |  6 +++---
 .../collections4/properties/SortedProperties.java      |  2 +-
 .../commons/collections4/CollectionUtilsTest.java      |  6 +++---
 .../collections4/iterators/IteratorIterableTest.java   |  4 ++--
 .../iterators/ObjectGraphIteratorTest.java             | 18 +++++++++---------
 .../commons/collections4/keyvalue/MultiKeyTest.java    |  4 ++--
 .../commons/collections4/map/MultiValueMapTest.java    |  4 ++--
 7 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/src/main/java/org/apache/commons/collections4/CollectionUtils.java b/src/main/java/org/apache/commons/collections4/CollectionUtils.java
index 9a531f4..d696a8f 100644
--- a/src/main/java/org/apache/commons/collections4/CollectionUtils.java
+++ b/src/main/java/org/apache/commons/collections4/CollectionUtils.java
@@ -892,7 +892,7 @@ public class CollectionUtils {
     public static <O> Collection<O> select(final Iterable<? extends O>
inputCollection,
                                            final Predicate<? super O> predicate) {
         final Collection<O> answer = inputCollection instanceof Collection<?>
?
-                new ArrayList<O>(((Collection<?>) inputCollection).size()) :
new ArrayList<O>();
+                new ArrayList<>(((Collection<?>) inputCollection).size()) : new
ArrayList<>();
         return select(inputCollection, predicate, answer);
     }
 
@@ -982,7 +982,7 @@ public class CollectionUtils {
     public static <O> Collection<O> selectRejected(final Iterable<? extends
O> inputCollection,
                                                    final Predicate<? super O> predicate)
{
         final Collection<O> answer = inputCollection instanceof Collection<?>
?
-                new ArrayList<O>(((Collection<?>) inputCollection).size()) :
new ArrayList<O>();
+                new ArrayList<>(((Collection<?>) inputCollection).size()) : new
ArrayList<>();
         return selectRejected(inputCollection, predicate, answer);
     }
 
@@ -1030,7 +1030,7 @@ public class CollectionUtils {
     public static <I, O> Collection<O> collect(final Iterable<I> inputCollection,
                                                final Transformer<? super I, ? extends
O> transformer) {
         final Collection<O> answer = inputCollection instanceof Collection<?>
?
-                new ArrayList<O>(((Collection<?>) inputCollection).size()) :
new ArrayList<O>();
+                new ArrayList<>(((Collection<?>) inputCollection).size()) : new
ArrayList<>();
         return collect(inputCollection, transformer, answer);
     }
 
diff --git a/src/main/java/org/apache/commons/collections4/properties/SortedProperties.java
b/src/main/java/org/apache/commons/collections4/properties/SortedProperties.java
index 833263f..3ab41be 100644
--- a/src/main/java/org/apache/commons/collections4/properties/SortedProperties.java
+++ b/src/main/java/org/apache/commons/collections4/properties/SortedProperties.java
@@ -46,6 +46,6 @@ public class SortedProperties extends Properties {
             keys.add(key.toString());
         }
         Collections.sort(keys);
-        return new IteratorEnumeration<Object>(keys.iterator());
+        return new IteratorEnumeration<>(keys.iterator());
     }
 }
diff --git a/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java b/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java
index 02c1fef..0ea3ebf 100644
--- a/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java
+++ b/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java
@@ -148,9 +148,9 @@ public class CollectionUtilsTest extends MockTestCase {
         iterableA = collectionA;
         iterableB = collectionB;
         iterableC = collectionC;
-        collectionA2 = new ArrayList<Number>(collectionA);
-        collectionB2 = new LinkedList<Number>(collectionB);
-        collectionC2 = new LinkedList<Number>(collectionC);
+        collectionA2 = new ArrayList<>(collectionA);
+        collectionB2 = new LinkedList<>(collectionB);
+        collectionC2 = new LinkedList<>(collectionC);
         iterableA2 = collectionA2;
         iterableB2 = collectionB2;
 
diff --git a/src/test/java/org/apache/commons/collections4/iterators/IteratorIterableTest.java
b/src/test/java/org/apache/commons/collections4/iterators/IteratorIterableTest.java
index d88e7ac..8e06e80 100644
--- a/src/test/java/org/apache/commons/collections4/iterators/IteratorIterableTest.java
+++ b/src/test/java/org/apache/commons/collections4/iterators/IteratorIterableTest.java
@@ -47,7 +47,7 @@ public class IteratorIterableTest extends BulkTest {
     @SuppressWarnings("unused")
     public void testIterator() {
         final Iterator<Integer> iter = createIterator();
-        final Iterable<Number> iterable = new IteratorIterable<Number>(iter);
+        final Iterable<Number> iterable = new IteratorIterable<>(iter);
 
         // first use
         verifyIteration(iterable);
@@ -61,7 +61,7 @@ public class IteratorIterableTest extends BulkTest {
     public void testMultipleUserIterator() {
         final Iterator<Integer> iter = createIterator();
 
-        final Iterable<Number> iterable = new IteratorIterable<Number>(iter,
true);
+        final Iterable<Number> iterable = new IteratorIterable<>(iter, true);
 
         // first use
         verifyIteration(iterable);
diff --git a/src/test/java/org/apache/commons/collections4/iterators/ObjectGraphIteratorTest.java
b/src/test/java/org/apache/commons/collections4/iterators/ObjectGraphIteratorTest.java
index 78024eb..caff4ed 100644
--- a/src/test/java/org/apache/commons/collections4/iterators/ObjectGraphIteratorTest.java
+++ b/src/test/java/org/apache/commons/collections4/iterators/ObjectGraphIteratorTest.java
@@ -67,7 +67,7 @@ public class ObjectGraphIteratorTest extends AbstractIteratorTest<Object>
{
 
     @Override
     public ObjectGraphIterator<Object> makeObject() {
-        return new ObjectGraphIterator<Object>(iteratorList.iterator());
+        return new ObjectGraphIterator<>(iteratorList.iterator());
     }
 
     //-----------------------------------------------------------------------
@@ -108,7 +108,7 @@ public class ObjectGraphIteratorTest extends AbstractIteratorTest<Object>
{
     //-----------------------------------------------------------------------
     public void testIteratorConstructorIteration_Empty() {
         final List<Iterator<Object>> iteratorList = new ArrayList<>();
-        final Iterator<Object> it = new ObjectGraphIterator<Object>(iteratorList.iterator());
+        final Iterator<Object> it = new ObjectGraphIterator<>(iteratorList.iterator());
 
         assertEquals(false, it.hasNext());
         try {
@@ -128,7 +128,7 @@ public class ObjectGraphIteratorTest extends AbstractIteratorTest<Object>
{
         iteratorList.add(list1.iterator());
         iteratorList.add(list2.iterator());
         iteratorList.add(list3.iterator());
-        final Iterator<Object> it = new ObjectGraphIterator<Object>(iteratorList.iterator());
+        final Iterator<Object> it = new ObjectGraphIterator<>(iteratorList.iterator());
 
         for (int i = 0; i < 6; i++) {
             assertEquals(true, it.hasNext());
@@ -147,7 +147,7 @@ public class ObjectGraphIteratorTest extends AbstractIteratorTest<Object>
{
         iteratorList.add(list1.iterator());
         iteratorList.add(list2.iterator());
         iteratorList.add(list3.iterator());
-        final Iterator<Object> it = new ObjectGraphIterator<Object>(iteratorList.iterator());
+        final Iterator<Object> it = new ObjectGraphIterator<>(iteratorList.iterator());
 
         for (int i = 0; i < 6; i++) {
             assertEquals(testArray[i], it.next());
@@ -168,7 +168,7 @@ public class ObjectGraphIteratorTest extends AbstractIteratorTest<Object>
{
         iteratorList.add(IteratorUtils.<String>emptyIterator());
         iteratorList.add(list3.iterator());
         iteratorList.add(IteratorUtils.<String>emptyIterator());
-        final Iterator<Object> it = new ObjectGraphIterator<Object>(iteratorList.iterator());
+        final Iterator<Object> it = new ObjectGraphIterator<>(iteratorList.iterator());
 
         for (int i = 0; i < 6; i++) {
             assertEquals(true, it.hasNext());
@@ -187,7 +187,7 @@ public class ObjectGraphIteratorTest extends AbstractIteratorTest<Object>
{
         iteratorList.add(list1.iterator());
         iteratorList.add(list2.iterator());
         iteratorList.add(list3.iterator());
-        final Iterator<Object> it = new ObjectGraphIterator<Object>(iteratorList.iterator());
+        final Iterator<Object> it = new ObjectGraphIterator<>(iteratorList.iterator());
 
         for (int i = 0; i < 6; i++) {
             assertEquals(testArray[i], it.next());
@@ -205,7 +205,7 @@ public class ObjectGraphIteratorTest extends AbstractIteratorTest<Object>
{
         iteratorList.add(list1.iterator());
         iteratorList.add(list2.iterator());
         iteratorList.add(list3.iterator());
-        final Iterator<Object> it = new ObjectGraphIterator<Object>(iteratorList.iterator(),
null);
+        final Iterator<Object> it = new ObjectGraphIterator<>(iteratorList.iterator(),
null);
 
         for (int i = 0; i < 6; i++) {
             assertEquals(true, it.hasNext());
@@ -223,7 +223,7 @@ public class ObjectGraphIteratorTest extends AbstractIteratorTest<Object>
{
         iteratorList.add(IteratorUtils.<String>emptyIterator());
         iteratorList.add(list3.iterator());
         iteratorList.add(IteratorUtils.<String>emptyIterator());
-        final Iterator<Object> it = new ObjectGraphIterator<Object>(iteratorList.iterator(),
null);
+        final Iterator<Object> it = new ObjectGraphIterator<>(iteratorList.iterator(),
null);
 
         for (int i = 0; i < 6; i++) {
             assertEquals(true, it.hasNext());
@@ -251,7 +251,7 @@ public class ObjectGraphIteratorTest extends AbstractIteratorTest<Object>
{
 
     public void testIteration_RootNoTransformer() {
         final Forest forest = new Forest();
-        final Iterator<Object> it = new ObjectGraphIterator<Object>(forest, null);
+        final Iterator<Object> it = new ObjectGraphIterator<>(forest, null);
 
         assertEquals(true, it.hasNext());
         assertSame(forest, it.next());
diff --git a/src/test/java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java b/src/test/java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java
index fc11a93..027dbd5 100644
--- a/src/test/java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java
+++ b/src/test/java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java
@@ -176,7 +176,7 @@ public class MultiKeyTest {
     public void testHashCode() {
         final MultiKey<Integer> mk1 = new MultiKey<>(ONE, TWO);
         final MultiKey<Integer> mk2 = new MultiKey<>(ONE, TWO);
-        final MultiKey<Object> mk3 = new MultiKey<Object>(ONE, "TWO");
+        final MultiKey<Object> mk3 = new MultiKey<>(ONE, "TWO");
 
         assertTrue(mk1.hashCode() == mk1.hashCode());
         assertTrue(mk1.hashCode() == mk2.hashCode());
@@ -190,7 +190,7 @@ public class MultiKeyTest {
     public void testEquals() {
         final MultiKey<Integer> mk1 = new MultiKey<>(ONE, TWO);
         final MultiKey<Integer> mk2 = new MultiKey<>(ONE, TWO);
-        final MultiKey<Object> mk3 = new MultiKey<Object>(ONE, "TWO");
+        final MultiKey<Object> mk3 = new MultiKey<>(ONE, "TWO");
 
         assertEquals(mk1, mk1);
         assertEquals(mk1, mk2);
diff --git a/src/test/java/org/apache/commons/collections4/map/MultiValueMapTest.java b/src/test/java/org/apache/commons/collections4/map/MultiValueMapTest.java
index dc57e0a..cd0dc6b 100644
--- a/src/test/java/org/apache/commons/collections4/map/MultiValueMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/map/MultiValueMapTest.java
@@ -124,8 +124,8 @@ public class MultiValueMapTest<K, V> extends AbstractObjectTest
{
 
     public void testKeyedIterator() {
         final MultiValueMap<K, V> map = createTestMap();
-        final ArrayList<Object> actual = new ArrayList<Object>(IteratorUtils.toList(map.iterator("one")));
-        final ArrayList<Object> expected = new ArrayList<Object>(Arrays.asList("uno",
"un"));
+        final ArrayList<Object> actual = new ArrayList<>(IteratorUtils.toList(map.iterator("one")));
+        final ArrayList<Object> expected = new ArrayList<>(Arrays.asList("uno",
"un"));
         assertEquals(expected, actual);
     }
 


Mime
View raw message