You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2013/04/29 01:09:52 UTC
svn commit: r1476853 - in
/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4:
BagUtilsTest.java CollectionUtilsTest.java ListUtilsTest.java
MapUtilsTest.java SetUtilsTest.java
Author: sebb
Date: Sun Apr 28 23:09:52 2013
New Revision: 1476853
URL: http://svn.apache.org/r1476853
Log:
Simplify and avoid complaints about "dead store to actual"
Modified:
commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/BagUtilsTest.java
commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java
commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/ListUtilsTest.java
commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/MapUtilsTest.java
commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/SetUtilsTest.java
Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/BagUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/BagUtilsTest.java?rev=1476853&r1=1476852&r2=1476853&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/BagUtilsTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/BagUtilsTest.java Sun Apr 28 23:09:52 2013
@@ -64,7 +64,7 @@ public class BagUtilsTest extends BulkTe
assertTrue("Returned object should be a SynchronizedBag.",
bag instanceof SynchronizedBag);
try {
- bag = BagUtils.synchronizedBag(null);
+ BagUtils.synchronizedBag(null);
fail("Expecting IllegalArgumentException for null bag.");
} catch (final IllegalArgumentException ex) {
// expected
@@ -76,7 +76,7 @@ public class BagUtilsTest extends BulkTe
assertTrue("Returned object should be an UnmodifiableBag.",
bag instanceof UnmodifiableBag);
try {
- bag = BagUtils.unmodifiableBag(null);
+ BagUtils.unmodifiableBag(null);
fail("Expecting IllegalArgumentException for null bag.");
} catch (final IllegalArgumentException ex) {
// expected
@@ -88,13 +88,13 @@ public class BagUtilsTest extends BulkTe
assertTrue("Returned object should be a PredicatedBag.",
bag instanceof PredicatedBag);
try {
- bag = BagUtils.predicatedBag(null,truePredicate);
+ BagUtils.predicatedBag(null,truePredicate);
fail("Expecting IllegalArgumentException for null bag.");
} catch (final IllegalArgumentException ex) {
// expected
}
try {
- bag = BagUtils.predicatedBag(new HashBag<Object>(), null);
+ BagUtils.predicatedBag(new HashBag<Object>(), null);
fail("Expecting IllegalArgumentException for null predicate.");
} catch (final IllegalArgumentException ex) {
// expected
@@ -106,13 +106,13 @@ public class BagUtilsTest extends BulkTe
assertTrue("Returned object should be an TransformedBag.",
bag instanceof TransformedBag);
try {
- bag = BagUtils.transformingBag(null, nopTransformer);
+ BagUtils.transformingBag(null, nopTransformer);
fail("Expecting IllegalArgumentException for null bag.");
} catch (final IllegalArgumentException ex) {
// expected
}
try {
- bag = BagUtils.transformingBag(new HashBag<Object>(), null);
+ BagUtils.transformingBag(new HashBag<Object>(), null);
fail("Expecting IllegalArgumentException for null transformer.");
} catch (final IllegalArgumentException ex) {
// expected
@@ -124,7 +124,7 @@ public class BagUtilsTest extends BulkTe
assertTrue("Returned object should be a SynchronizedSortedBag.",
bag instanceof SynchronizedSortedBag);
try {
- bag = BagUtils.synchronizedSortedBag(null);
+ BagUtils.synchronizedSortedBag(null);
fail("Expecting IllegalArgumentException for null bag.");
} catch (final IllegalArgumentException ex) {
// expected
@@ -136,7 +136,7 @@ public class BagUtilsTest extends BulkTe
assertTrue("Returned object should be an UnmodifiableSortedBag.",
bag instanceof UnmodifiableSortedBag);
try {
- bag = BagUtils.unmodifiableSortedBag(null);
+ BagUtils.unmodifiableSortedBag(null);
fail("Expecting IllegalArgumentException for null bag.");
} catch (final IllegalArgumentException ex) {
// expected
@@ -148,13 +148,13 @@ public class BagUtilsTest extends BulkTe
assertTrue("Returned object should be a PredicatedSortedBag.",
bag instanceof PredicatedSortedBag);
try {
- bag = BagUtils.predicatedSortedBag(null, truePredicate);
+ BagUtils.predicatedSortedBag(null, truePredicate);
fail("Expecting IllegalArgumentException for null bag.");
} catch (final IllegalArgumentException ex) {
// expected
}
try {
- bag = BagUtils.predicatedSortedBag(new TreeBag<Object>(), null);
+ BagUtils.predicatedSortedBag(new TreeBag<Object>(), null);
fail("Expecting IllegalArgumentException for null predicate.");
} catch (final IllegalArgumentException ex) {
// expected
@@ -166,13 +166,13 @@ public class BagUtilsTest extends BulkTe
assertTrue("Returned object should be an TransformedSortedBag",
bag instanceof TransformedSortedBag);
try {
- bag = BagUtils.transformingSortedBag(null, nopTransformer);
+ BagUtils.transformingSortedBag(null, nopTransformer);
fail("Expecting IllegalArgumentException for null bag.");
} catch (final IllegalArgumentException ex) {
// expected
}
try {
- bag = BagUtils.transformingSortedBag(new TreeBag<Object>(), null);
+ BagUtils.transformingSortedBag(new TreeBag<Object>(), null);
fail("Expecting IllegalArgumentException for null transformer.");
} catch (final IllegalArgumentException ex) {
// expected
Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java?rev=1476853&r1=1476852&r2=1476853&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java Sun Apr 28 23:09:52 2013
@@ -1279,7 +1279,7 @@ public class CollectionUtilsTest extends
Collection<Number> collection = CollectionUtils.predicatedCollection(new ArrayList<Number>(), predicate);
assertTrue("returned object should be a PredicatedCollection", collection instanceof PredicatedCollection);
try {
- collection = CollectionUtils.predicatedCollection(new ArrayList<Number>(), null);
+ CollectionUtils.predicatedCollection(new ArrayList<Number>(), null);
fail("Expecting IllegalArgumentException for null predicate.");
} catch (final IllegalArgumentException ex) {
// expected
@@ -1454,13 +1454,13 @@ public class CollectionUtilsTest extends
Collection<Object> collection = CollectionUtils.transformingCollection(new ArrayList<Object>(), transformer);
assertTrue("returned object should be a TransformedCollection", collection instanceof TransformedCollection);
try {
- collection = CollectionUtils.transformingCollection(new ArrayList<Object>(), null);
+ CollectionUtils.transformingCollection(new ArrayList<Object>(), null);
fail("Expecting IllegalArgumentException for null transformer.");
} catch (final IllegalArgumentException ex) {
// expected
}
try {
- collection = CollectionUtils.transformingCollection(null, transformer);
+ CollectionUtils.transformingCollection(null, transformer);
fail("Expecting IllegalArgumentException for null collection.");
} catch (final IllegalArgumentException ex) {
// expected
@@ -1484,7 +1484,7 @@ public class CollectionUtilsTest extends
Collection<Object> col = CollectionUtils.synchronizedCollection(new ArrayList<Object>());
assertTrue("Returned object should be a SynchronizedCollection.", col instanceof SynchronizedCollection);
try {
- col = CollectionUtils.synchronizedCollection(null);
+ CollectionUtils.synchronizedCollection(null);
fail("Expecting IllegalArgumentException for null collection.");
} catch (final IllegalArgumentException ex) {
// expected
@@ -1496,7 +1496,7 @@ public class CollectionUtilsTest extends
Collection<Object> col = CollectionUtils.unmodifiableCollection(new ArrayList<Object>());
assertTrue("Returned object should be a UnmodifiableCollection.", col instanceof UnmodifiableCollection);
try {
- col = CollectionUtils.unmodifiableCollection(null);
+ CollectionUtils.unmodifiableCollection(null);
fail("Expecting IllegalArgumentException for null collection.");
} catch (final IllegalArgumentException ex) {
// expected
Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/ListUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/ListUtilsTest.java?rev=1476853&r1=1476852&r2=1476853&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/ListUtilsTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/ListUtilsTest.java Sun Apr 28 23:09:52 2013
@@ -137,13 +137,13 @@ public class ListUtilsTest extends BulkT
List<Object> list = ListUtils.predicatedList(new ArrayList<Object>(), predicate);
assertTrue("returned object should be a PredicatedList", list instanceof PredicatedList);
try {
- list = ListUtils.predicatedList(new ArrayList<Object>(), null);
+ ListUtils.predicatedList(new ArrayList<Object>(), null);
fail("Expecting IllegalArgumentException for null predicate.");
} catch (final IllegalArgumentException ex) {
// expected
}
try {
- list = ListUtils.predicatedList(null, predicate);
+ ListUtils.predicatedList(null, predicate);
fail("Expecting IllegalArgumentException for null list.");
} catch (final IllegalArgumentException ex) {
// expected
Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/MapUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/MapUtilsTest.java?rev=1476853&r1=1476852&r2=1476853&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/MapUtilsTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/MapUtilsTest.java Sun Apr 28 23:09:52 2013
@@ -77,7 +77,7 @@ public class MapUtilsTest extends BulkTe
Map<Object, Object> map = MapUtils.predicatedMap(new HashMap<Object, Object>(), p, p);
assertTrue("returned object should be a PredicatedMap", map instanceof PredicatedMap);
try {
- map = MapUtils.predicatedMap(null, p, p);
+ MapUtils.predicatedMap(null, p, p);
fail("Expecting IllegalArgumentException for null map.");
} catch (final IllegalArgumentException e) {
// expected
Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/SetUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/SetUtilsTest.java?rev=1476853&r1=1476852&r2=1476853&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/SetUtilsTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/SetUtilsTest.java Sun Apr 28 23:09:52 2013
@@ -54,13 +54,13 @@ public class SetUtilsTest extends BulkTe
Set<Object> set = SetUtils.predicatedSet(new HashSet<Object>(), predicate);
assertTrue("returned object should be a PredicatedSet", set instanceof PredicatedSet);
try {
- set = SetUtils.predicatedSet(new HashSet<Object>(), null);
+ SetUtils.predicatedSet(new HashSet<Object>(), null);
fail("Expecting IllegalArgumentException for null predicate.");
} catch (final IllegalArgumentException ex) {
// expected
}
try {
- set = SetUtils.predicatedSet(null, predicate);
+ SetUtils.predicatedSet(null, predicate);
fail("Expecting IllegalArgumentException for null set.");
} catch (final IllegalArgumentException ex) {
// expected