[COLLECTIONS-451] Hide constructors for *Utils classes.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1457508 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7ec6ca6814
commit
a2be810bb5
|
@ -47,11 +47,9 @@ public class BagUtils {
|
|||
UnmodifiableSortedBag.unmodifiableSortedBag(new TreeBag<Object>());
|
||||
|
||||
/**
|
||||
* Instantiation of BagUtils is not intended or required. However, some
|
||||
* tools require an instance to operate.
|
||||
* Instantiation of BagUtils is not intended or required.
|
||||
*/
|
||||
public BagUtils() {
|
||||
}
|
||||
private BagUtils() {}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
/**
|
||||
|
|
|
@ -55,9 +55,7 @@ public class ClosureUtils {
|
|||
/**
|
||||
* This class is not normally instantiated.
|
||||
*/
|
||||
public ClosureUtils() {
|
||||
super();
|
||||
}
|
||||
private ClosureUtils() {}
|
||||
|
||||
/**
|
||||
* Gets a Closure that always throws an exception.
|
||||
|
|
|
@ -195,8 +195,7 @@ public class CollectionUtils {
|
|||
/**
|
||||
* <code>CollectionUtils</code> should not normally be instantiated.
|
||||
*/
|
||||
public CollectionUtils() {
|
||||
}
|
||||
private CollectionUtils() {}
|
||||
|
||||
/**
|
||||
* Returns the immutable EMPTY_COLLECTION with generic type safety.
|
||||
|
|
|
@ -43,8 +43,7 @@ public class ComparatorUtils {
|
|||
/**
|
||||
* ComparatorUtils should not normally be instantiated.
|
||||
*/
|
||||
public ComparatorUtils() {
|
||||
}
|
||||
private ComparatorUtils() {}
|
||||
|
||||
/**
|
||||
* Comparator for natural sort order.
|
||||
|
|
|
@ -34,9 +34,7 @@ public class EnumerationUtils {
|
|||
/**
|
||||
* EnumerationUtils is not normally instantiated.
|
||||
*/
|
||||
public EnumerationUtils() {
|
||||
// no init.
|
||||
}
|
||||
private EnumerationUtils() {}
|
||||
|
||||
/**
|
||||
* Creates a list based on an enumeration.
|
||||
|
|
|
@ -41,9 +41,7 @@ public class FactoryUtils {
|
|||
/**
|
||||
* This class is not normally instantiated.
|
||||
*/
|
||||
public FactoryUtils() {
|
||||
super();
|
||||
}
|
||||
private FactoryUtils() {}
|
||||
|
||||
/**
|
||||
* Gets a Factory that always throws an exception.
|
||||
|
|
|
@ -112,8 +112,7 @@ public class IteratorUtils {
|
|||
/**
|
||||
* IteratorUtils is not normally instantiated.
|
||||
*/
|
||||
public IteratorUtils() {
|
||||
}
|
||||
private IteratorUtils() {}
|
||||
|
||||
// Empty
|
||||
//-----------------------------------------------------------------------
|
||||
|
|
|
@ -50,8 +50,7 @@ public class ListUtils {
|
|||
/**
|
||||
* <code>ListUtils</code> should not normally be instantiated.
|
||||
*/
|
||||
public ListUtils() {
|
||||
}
|
||||
private ListUtils() {}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -97,8 +97,7 @@ public class MapUtils {
|
|||
/**
|
||||
* <code>MapUtils</code> should not normally be instantiated.
|
||||
*/
|
||||
public MapUtils() {
|
||||
}
|
||||
private MapUtils() {}
|
||||
|
||||
// Type safe getters
|
||||
//-------------------------------------------------------------------------
|
||||
|
|
|
@ -74,9 +74,7 @@ public class PredicateUtils {
|
|||
/**
|
||||
* This class is not normally instantiated.
|
||||
*/
|
||||
public PredicateUtils() {
|
||||
super();
|
||||
}
|
||||
private PredicateUtils() {}
|
||||
|
||||
// Simple predicates
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -77,8 +77,7 @@ public class SetUtils {
|
|||
/**
|
||||
* <code>SetUtils</code> should not normally be instantiated.
|
||||
*/
|
||||
public SetUtils() {
|
||||
}
|
||||
private SetUtils() {}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -41,8 +41,9 @@ public class SplitMapUtils {
|
|||
/**
|
||||
* <code>SplitMapUtils</code> should not normally be instantiated.
|
||||
*/
|
||||
public SplitMapUtils() {
|
||||
}
|
||||
private SplitMapUtils() {}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
private static class WrappedGet<K, V> implements IterableMap<K, V>, Unmodifiable {
|
||||
private final Get<K, V> get;
|
||||
|
@ -193,6 +194,8 @@ public class SplitMapUtils {
|
|||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Get the specified {@link Get} as an instance of {@link IterableMap}.
|
||||
* If <code>get</code> implements {@link IterableMap} directly, no conversion will take place.
|
||||
|
|
|
@ -64,9 +64,7 @@ public class TransformerUtils {
|
|||
/**
|
||||
* This class is not normally instantiated.
|
||||
*/
|
||||
public TransformerUtils() {
|
||||
super();
|
||||
}
|
||||
private TransformerUtils() {}
|
||||
|
||||
/**
|
||||
* Gets a transformer that always throws an exception.
|
||||
|
|
|
@ -1523,15 +1523,6 @@ public class CollectionUtilsTest extends MockTestCase {
|
|||
(Object)map, 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: Should {@link CollectionUtils} be able to be extended? If it is extended, subclasses must 'override' the static methods with
|
||||
* call-throughs anyhow, otherwise java compiler warnings will result
|
||||
*/
|
||||
@Test
|
||||
public void ensureCollectionUtilsCanBeExtended() {
|
||||
new CollectionUtils() {};
|
||||
}
|
||||
|
||||
@Test
|
||||
public void reverse() {
|
||||
CollectionUtils.reverseArray(new Object[] {});
|
||||
|
|
Loading…
Reference in New Issue