Simplify and avoid complaints about "dead store to actual"
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1476853 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
90634a969a
commit
05afd18933
|
@ -64,7 +64,7 @@ public class BagUtilsTest extends BulkTest {
|
|||
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 BulkTest {
|
|||
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 BulkTest {
|
|||
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 BulkTest {
|
|||
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 BulkTest {
|
|||
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 BulkTest {
|
|||
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 BulkTest {
|
|||
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 BulkTest {
|
|||
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
|
||||
|
|
|
@ -1279,7 +1279,7 @@ public class CollectionUtilsTest extends MockTestCase {
|
|||
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 MockTestCase {
|
|||
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 MockTestCase {
|
|||
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 MockTestCase {
|
|||
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
|
||||
|
|
|
@ -137,13 +137,13 @@ public class ListUtilsTest extends BulkTest {
|
|||
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
|
||||
|
|
|
@ -77,7 +77,7 @@ public class MapUtilsTest extends BulkTest {
|
|||
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
|
||||
|
|
|
@ -54,13 +54,13 @@ public class SetUtilsTest extends BulkTest {
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue