Fix checkstyle warnings: line longer than 120 chars.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1435824 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas Neidhart 2013-01-20 11:41:17 +00:00
parent 99b53bcce8
commit 1b9d8b4b3e
35 changed files with 144 additions and 73 deletions

View File

@ -187,7 +187,8 @@ public class BufferUtils {
* @return a transformed buffer backed by the given buffer
* @throws IllegalArgumentException if the Buffer or Transformer is null
*/
public static <E> Buffer<E> transformingBuffer(final Buffer<E> buffer, final Transformer<? super E, ? extends E> transformer) {
public static <E> Buffer<E> transformingBuffer(final Buffer<E> buffer,
final Transformer<? super E, ? extends E> transformer) {
return TransformedBuffer.transformingBuffer(buffer, transformer);
}

View File

@ -172,7 +172,8 @@ public class ClosureUtils {
* @throws IllegalArgumentException if the method name is null
* @throws IllegalArgumentException if the paramTypes and args don't match
*/
public static <E> Closure<E> invokerClosure(final String methodName, final Class<?>[] paramTypes, final Object[] args) {
public static <E> Closure<E> invokerClosure(final String methodName, final Class<?>[] paramTypes,
final Object[] args) {
// reuse transformer as it has caching - this is lazy really, should have inner class here
return asClosure(InvokerTransformer.<E, Object>invokerTransformer(methodName, paramTypes, args));
}
@ -237,7 +238,8 @@ public class ClosureUtils {
* @throws IllegalArgumentException if the closure is null
* @since 3.2
*/
public static <E> Closure<E> ifClosure(final Predicate<? super E> predicate, final Closure<? super E> trueClosure) {
public static <E> Closure<E> ifClosure(final Predicate<? super E> predicate,
final Closure<? super E> trueClosure) {
return IfClosure.<E>ifClosure(predicate, trueClosure);
}
@ -277,7 +279,8 @@ public class ClosureUtils {
* @throws IllegalArgumentException if any element in the arrays is null
* @throws IllegalArgumentException if the arrays are different sizes
*/
public static <E> Closure<E> switchClosure(final Predicate<? super E>[] predicates, final Closure<? super E>[] closures) {
public static <E> Closure<E> switchClosure(final Predicate<? super E>[] predicates,
final Closure<? super E>[] closures) {
return SwitchClosure.<E>switchClosure(predicates, closures, null);
}

View File

@ -699,8 +699,9 @@ public class CollectionUtils {
* and predicate or not null
* @return outputCollection
*/
public static <O, R extends Collection<? super O>> R selectRejected(
final Collection<? extends O> inputCollection, final Predicate<? super O> predicate, final R outputCollection) {
public static <O, R extends Collection<? super O>> R selectRejected(final Collection<? extends O> inputCollection,
final Predicate<? super O> predicate, final R outputCollection) {
if (inputCollection != null && predicate != null) {
for (final O item : inputCollection) {
if (!predicate.evaluate(item)) {
@ -1213,7 +1214,8 @@ public class CollectionUtils {
return ((BoundedCollection<?>) coll).isFull();
}
try {
final BoundedCollection<?> bcoll = UnmodifiableBoundedCollection.unmodifiableBoundedCollection((Collection<Object>) coll);
final BoundedCollection<?> bcoll =
UnmodifiableBoundedCollection.unmodifiableBoundedCollection((Collection<Object>) coll);
return bcoll.isFull();
} catch (final IllegalArgumentException ex) {
return false;
@ -1244,7 +1246,8 @@ public class CollectionUtils {
return ((BoundedCollection<?>) coll).maxSize();
}
try {
final BoundedCollection<?> bcoll = UnmodifiableBoundedCollection.unmodifiableBoundedCollection((Collection<Object>) coll);
final BoundedCollection<?> bcoll =
UnmodifiableBoundedCollection.unmodifiableBoundedCollection((Collection<Object>) coll);
return bcoll.maxSize();
} catch (final IllegalArgumentException ex) {
return -1;
@ -1345,7 +1348,8 @@ public class CollectionUtils {
* @return a predicated collection backed by the given collection
* @throws IllegalArgumentException if the Collection is null
*/
public static <C> Collection<C> predicatedCollection(final Collection<C> collection, final Predicate<? super C> predicate) {
public static <C> Collection<C> predicatedCollection(final Collection<C> collection,
final Predicate<? super C> predicate) {
return PredicatedCollection.predicatedCollection(collection, predicate);
}
@ -1364,7 +1368,8 @@ public class CollectionUtils {
* @return a transformed collection backed by the given collection
* @throws IllegalArgumentException if the Collection or Transformer is null
*/
public static <E> Collection<E> transformingCollection(final Collection<E> collection, final Transformer<? super E, ? extends E> transformer) {
public static <E> Collection<E> transformingCollection(final Collection<E> collection,
final Transformer<? super E, ? extends E> transformer) {
return TransformedCollection.transformingCollection(collection, transformer);
}

View File

@ -90,7 +90,9 @@ public class ComparatorUtils {
* @throws NullPointerException if comparators array is null or contains a null
* @see ComparatorChain
*/
public static <E extends Comparable<? super E>> Comparator<E> chainedComparator(final Comparator<E>[] comparators) {
public static <E extends Comparable<? super E>> Comparator<E> chainedComparator(
final Comparator<E>[] comparators) {
final ComparatorChain<E> chain = new ComparatorChain<E>();
for (final Comparator<E> comparator : comparators) {
if (comparator == null) {
@ -113,7 +115,9 @@ public class ComparatorUtils {
* @see ComparatorChain
*/
@SuppressWarnings("unchecked")
public static <E extends Comparable<? super E>> Comparator<E> chainedComparator(final Collection<Comparator<E>> comparators) {
public static <E extends Comparable<? super E>> Comparator<E> chainedComparator(
final Collection<Comparator<E>> comparators) {
return chainedComparator(
(Comparator<E>[]) comparators.toArray(new Comparator[comparators.size()])
);
@ -197,7 +201,9 @@ public class ComparatorUtils {
* @see TransformingComparator
*/
@SuppressWarnings("unchecked")
public static <E> Comparator<E> transformedComparator(Comparator<E> comparator, final Transformer<? super E, ? extends E> transformer) {
public static <E> Comparator<E> transformedComparator(Comparator<E> comparator,
final Transformer<? super E, ? extends E> transformer) {
if (comparator == null) {
comparator = NATURAL_COMPARATOR;
}

View File

@ -138,7 +138,8 @@ public class FactoryUtils {
* @throws IllegalArgumentException if the paramTypes and args don't match
* @throws IllegalArgumentException if the constructor doesn't exist
*/
public static <T> Factory<T> instantiateFactory(final Class<T> classToInstantiate, final Class<?>[] paramTypes, final Object[] args) {
public static <T> Factory<T> instantiateFactory(final Class<T> classToInstantiate, final Class<?>[] paramTypes,
final Object[] args) {
return InstantiateFactory.instantiateFactory(classToInstantiate, paramTypes, args);
}

View File

@ -103,7 +103,8 @@ public class IteratorUtils {
/**
* An ordered map iterator over no elements.
*/
public static final OrderedMapIterator<Object, Object> EMPTY_ORDERED_MAP_ITERATOR = EmptyOrderedMapIterator.INSTANCE;
public static final OrderedMapIterator<Object, Object> EMPTY_ORDERED_MAP_ITERATOR =
EmptyOrderedMapIterator.INSTANCE;
/**
* IteratorUtils is not normally instantiated.
@ -454,7 +455,8 @@ public class IteratorUtils {
* @return a combination iterator over the iterators
* @throws NullPointerException if either iterator is null
*/
public static <E> Iterator<E> chainedIterator(final Iterator<? extends E> iterator1, final Iterator<? extends E> iterator2) {
public static <E> Iterator<E> chainedIterator(final Iterator<? extends E> iterator1,
final Iterator<? extends E> iterator2) {
return new IteratorChain<E>(iterator1, iterator2);
}
@ -501,7 +503,9 @@ public class IteratorUtils {
* @return a combination iterator over the iterators
* @throws NullPointerException if either iterator is null
*/
public static <E> Iterator<E> collatedIterator(final Comparator<? super E> comparator, final Iterator<? extends E> iterator1, final Iterator<? extends E> iterator2) {
public static <E> Iterator<E> collatedIterator(final Comparator<? super E> comparator,
final Iterator<? extends E> iterator1,
final Iterator<? extends E> iterator2) {
return new CollatingIterator<E>(comparator, iterator1, iterator2);
}
@ -520,7 +524,8 @@ public class IteratorUtils {
* @return a combination iterator over the iterators
* @throws NullPointerException if iterators array is null or contains a null
*/
public static <E> Iterator<E> collatedIterator(final Comparator<? super E> comparator, final Iterator<? extends E>[] iterators) {
public static <E> Iterator<E> collatedIterator(final Comparator<? super E> comparator,
final Iterator<? extends E>[] iterators) {
return new CollatingIterator<E>(comparator, iterators);
}
@ -600,7 +605,8 @@ public class IteratorUtils {
* @return a new object graph iterator
* @since 3.1
*/
public static <E> Iterator<E> objectGraphIterator(final E root, final Transformer<? super E, ? extends E> transformer) {
public static <E> Iterator<E> objectGraphIterator(final E root,
final Transformer<? super E, ? extends E> transformer) {
return new ObjectGraphIterator<E>(root, transformer);
}
@ -617,7 +623,9 @@ public class IteratorUtils {
* @return a new transforming iterator
* @throws NullPointerException if either parameter is null
*/
public static <I, O> Iterator<O> transformedIterator(final Iterator<? extends I> iterator, final Transformer<? super I, ? extends O> transform) {
public static <I, O> Iterator<O> transformedIterator(final Iterator<? extends I> iterator,
final Transformer<? super I, ? extends O> transform) {
if (iterator == null) {
throw new NullPointerException("Iterator must not be null");
}
@ -640,7 +648,8 @@ public class IteratorUtils {
* @return a new filtered iterator
* @throws NullPointerException if either parameter is null
*/
public static <E> Iterator<E> filteredIterator(final Iterator<? extends E> iterator, final Predicate<? super E> predicate) {
public static <E> Iterator<E> filteredIterator(final Iterator<? extends E> iterator,
final Predicate<? super E> predicate) {
if (iterator == null) {
throw new NullPointerException("Iterator must not be null");
}
@ -661,7 +670,9 @@ public class IteratorUtils {
* @return a new filtered iterator
* @throws NullPointerException if either parameter is null
*/
public static <E> ListIterator<E> filteredListIterator(final ListIterator<? extends E> listIterator, final Predicate<? super E> predicate) {
public static <E> ListIterator<E> filteredListIterator(final ListIterator<? extends E> listIterator,
final Predicate<? super E> predicate) {
if (listIterator == null) {
throw new NullPointerException("ListIterator must not be null");
}
@ -732,7 +743,8 @@ public class IteratorUtils {
* @param removeCollection the collection to remove elements from
* @return a new iterator
*/
public static <E> Iterator<E> asIterator(final Enumeration<? extends E> enumeration, final Collection<? super E> removeCollection) {
public static <E> Iterator<E> asIterator(final Enumeration<? extends E> enumeration,
final Collection<? super E> removeCollection) {
if (enumeration == null) {
throw new NullPointerException("Enumeration must not be null");
}

View File

@ -430,7 +430,8 @@ public class ListUtils {
* @return a transformed list backed by the given list
* @throws IllegalArgumentException if the List or Transformer is null
*/
public static <E> List<E> transformedList(final List<E> list, final Transformer<? super E, ? extends E> transformer) {
public static <E> List<E> transformedList(final List<E> list,
final Transformer<? super E, ? extends E> transformer) {
return TransformedList.transformingList(list, transformer);
}

View File

@ -1076,7 +1076,8 @@ public class MapUtils {
* @param value the value, null converted to ""
* @throws NullPointerException if the map is null
*/
public static <K> void safeAddToMap(final Map<? super K, Object> map, final K key, final Object value) throws NullPointerException {
public static <K> void safeAddToMap(final Map<? super K, Object> map, final K key, final Object value)
throws NullPointerException {
map.put(key, value == null ? "" : value);
}
@ -1258,7 +1259,8 @@ public class MapUtils {
* @return a predicated map backed by the given map
* @throws IllegalArgumentException if the Map is null
*/
public static <K, V> IterableMap<K, V> predicatedMap(final Map<K, V> map, final Predicate<? super K> keyPred, final Predicate<? super V> valuePred) {
public static <K, V> IterableMap<K, V> predicatedMap(final Map<K, V> map, final Predicate<? super K> keyPred,
final Predicate<? super V> valuePred) {
return PredicatedMap.predicatedMap(map, keyPred, valuePred);
}
@ -1370,7 +1372,8 @@ public class MapUtils {
* @return a lazy map backed by the given map
* @throws IllegalArgumentException if the Map or Transformer is null
*/
public static <K, V> IterableMap<K, V> lazyMap(final Map<K, V> map, final Transformer<? super K, ? extends V> transformerFactory) {
public static <K, V> IterableMap<K, V> lazyMap(final Map<K, V> map,
final Transformer<? super K, ? extends V> transformerFactory) {
return LazyMap.lazyMap(map, transformerFactory);
}
@ -1413,7 +1416,8 @@ public class MapUtils {
* @see MultiValueMap
* @since 3.2
*/
public static <K, V, C extends Collection<V>> MultiValueMap<K, V> multiValueMap(final Map<K, C> map, final Class<C> collectionClass) {
public static <K, V, C extends Collection<V>> MultiValueMap<K, V> multiValueMap(final Map<K, C> map,
final Class<C> collectionClass) {
return MultiValueMap.multiValueMap(map, collectionClass);
}
@ -1428,7 +1432,8 @@ public class MapUtils {
* @see MultiValueMap
* @since 3.2
*/
public static <K, V, C extends Collection<V>> MultiValueMap<K, V> multiValueMap(final Map<K, C> map, final Factory<C> collectionFactory) {
public static <K, V, C extends Collection<V>> MultiValueMap<K, V> multiValueMap(final Map<K, C> map,
final Factory<C> collectionFactory) {
return MultiValueMap.multiValueMap(map, collectionFactory);
}
@ -1619,7 +1624,8 @@ public class MapUtils {
* @param keyTransformer the <code>Transformer</code> used to transform the collection value into a key value
* @throws NullPointerException if the map, collection or transformer are null
*/
public static <K, V> void populateMap(final Map<K, V> map, final Collection<? extends V> collection, final Transformer<V, K> keyTransformer) {
public static <K, V> void populateMap(final Map<K, V> map, final Collection<? extends V> collection,
final Transformer<V, K> keyTransformer) {
populateMap(map, collection, keyTransformer, TransformerUtils.<V>nopTransformer());
}
@ -1635,8 +1641,8 @@ public class MapUtils {
* @throws NullPointerException if the map, collection or transformers are null
*/
public static <K, V, E> void populateMap(final Map<K, V> map, final Collection<? extends E> collection,
final Transformer<E, K> keyTransformer,
final Transformer<E, V> valueTransformer) {
final Transformer<E, K> keyTransformer,
final Transformer<E, V> valueTransformer) {
final Iterator<? extends E> iter = collection.iterator();
while (iter.hasNext()) {
final E temp = iter.next();

View File

@ -244,7 +244,8 @@ public class PredicateUtils {
* @throws IllegalArgumentException if the method name is null
* @throws IllegalArgumentException if the paramTypes and args don't match
*/
public static <T> Predicate<T> invokerPredicate(final String methodName, final Class<?>[] paramTypes, final Object[] args){
public static <T> Predicate<T> invokerPredicate(final String methodName, final Class<?>[] paramTypes,
final Object[] args) {
// reuse transformer as it has caching - this is lazy really, should have inner class here
return asPredicate(InvokerTransformer.<Object, Boolean>invokerTransformer(methodName, paramTypes, args));
}
@ -263,7 +264,8 @@ public class PredicateUtils {
* @return the <code>and</code> predicate
* @throws IllegalArgumentException if either predicate is null
*/
public static <T> Predicate<T> andPredicate(final Predicate<? super T> predicate1, final Predicate<? super T> predicate2) {
public static <T> Predicate<T> andPredicate(final Predicate<? super T> predicate1,
final Predicate<? super T> predicate2) {
return AndPredicate.<T>andPredicate(predicate1, predicate2);
}
@ -312,7 +314,8 @@ public class PredicateUtils {
* @return the <code>or</code> predicate
* @throws IllegalArgumentException if either predicate is null
*/
public static <T> Predicate<T> orPredicate(final Predicate<? super T> predicate1, final Predicate<? super T> predicate2) {
public static <T> Predicate<T> orPredicate(final Predicate<? super T> predicate1,
final Predicate<? super T> predicate2) {
return OrPredicate.<T>orPredicate(predicate1, predicate2);
}
@ -359,7 +362,8 @@ public class PredicateUtils {
* @return the <code>either</code> predicate
* @throws IllegalArgumentException if either predicate is null
*/
public static <T> Predicate<T> eitherPredicate(final Predicate<? super T> predicate1, final Predicate<? super T> predicate2) {
public static <T> Predicate<T> eitherPredicate(final Predicate<? super T> predicate1,
final Predicate<? super T> predicate2) {
@SuppressWarnings("unchecked")
final
Predicate<T> onePredicate = PredicateUtils.<T>onePredicate(predicate1, predicate2);
@ -409,7 +413,8 @@ public class PredicateUtils {
* @return the <code>neither</code> predicate
* @throws IllegalArgumentException if either predicate is null
*/
public static <T> Predicate<T> neitherPredicate(final Predicate<? super T> predicate1, final Predicate<? super T> predicate2) {
public static <T> Predicate<T> neitherPredicate(final Predicate<? super T> predicate1,
final Predicate<? super T> predicate2) {
@SuppressWarnings("unchecked")
final
Predicate<T> nonePredicate = PredicateUtils.<T>nonePredicate(predicate1, predicate2);

View File

@ -337,7 +337,9 @@ public class TransformerUtils {
* @throws IllegalArgumentException if any transformer in the map is null
*/
@SuppressWarnings("unchecked")
public static <I, O> Transformer<I, O> switchMapTransformer(final Map<I, Transformer<I, O>> objectsAndTransformers) {
public static <I, O> Transformer<I, O> switchMapTransformer(
final Map<I, Transformer<I, O>> objectsAndTransformers) {
Transformer<? super I, ? extends O>[] trs = null;
Predicate<I>[] preds = null;
if (objectsAndTransformers == null) {
@ -411,7 +413,7 @@ public class TransformerUtils {
* @return the transformer
* @throws IllegalArgumentException if the methodName is null.
*/
public static <I, O> Transformer<I, O> invokerTransformer(final String methodName){
public static <I, O> Transformer<I, O> invokerTransformer(final String methodName) {
return InvokerTransformer.<I, O>invokerTransformer(methodName, null, null);
}
@ -429,7 +431,8 @@ public class TransformerUtils {
* @throws IllegalArgumentException if the method name is null
* @throws IllegalArgumentException if the paramTypes and args don't match
*/
public static <I, O> Transformer<I, O> invokerTransformer(final String methodName, final Class<?>[] paramTypes, final Object[] args){
public static <I, O> Transformer<I, O> invokerTransformer(final String methodName, final Class<?>[] paramTypes,
final Object[] args) {
return InvokerTransformer.<I, O>invokerTransformer(methodName, paramTypes, args);
}

View File

@ -55,7 +55,8 @@ public class PredicatedSortedBag<E> extends PredicatedBag<E> implements SortedBa
* @throws IllegalArgumentException if bag or predicate is null
* @throws IllegalArgumentException if the bag contains invalid elements
*/
public static <E> PredicatedSortedBag<E> predicatedSortedBag(final SortedBag<E> bag, final Predicate<? super E> predicate) {
public static <E> PredicatedSortedBag<E> predicatedSortedBag(final SortedBag<E> bag,
final Predicate<? super E> predicate) {
return new PredicatedSortedBag<E>(bag, predicate);
}

View File

@ -52,7 +52,7 @@ public class TransformedSortedBag<E> extends TransformedBag<E> implements Sorted
* @throws IllegalArgumentException if bag or transformer is null
*/
public static <E> TransformedSortedBag<E> transformingSortedBag(final SortedBag<E> bag,
final Transformer<? super E, ? extends E> transformer) {
final Transformer<? super E, ? extends E> transformer) {
return new TransformedSortedBag<E>(bag, transformer);
}
@ -72,7 +72,8 @@ public class TransformedSortedBag<E> extends TransformedBag<E> implements Sorted
* @since 3.3
*/
public static <E> TransformedSortedBag<E> transformedSortedBag(final SortedBag<E> bag,
final Transformer<? super E, ? extends E> transformer) {
final Transformer<? super E, ? extends E> transformer) {
final TransformedSortedBag<E> decorated = new TransformedSortedBag<E>(bag, transformer);
if (transformer != null && bag != null && bag.size() > 0) {
@SuppressWarnings("unchecked") // bag is type E

View File

@ -110,7 +110,8 @@ public abstract class AbstractDualBidiMap<K, V> implements BidiMap<K, V> {
* @param reverseMap the reverse direction map
* @param inverseBidiMap the inverse BidiMap
*/
protected AbstractDualBidiMap(final Map<K, V> normalMap, final Map<V, K> reverseMap, final BidiMap<V, K> inverseBidiMap) {
protected AbstractDualBidiMap(final Map<K, V> normalMap, final Map<V, K> reverseMap,
final BidiMap<V, K> inverseBidiMap) {
super();
this.normalMap = normalMap;
this.reverseMap = reverseMap;

View File

@ -69,7 +69,8 @@ public class DualHashBidiMap<K, V> extends AbstractDualBidiMap<K, V> implements
* @param reverseMap the reverse direction map
* @param inverseBidiMap the inverse BidiMap
*/
protected DualHashBidiMap(final Map<K, V> normalMap, final Map<V, K> reverseMap, final BidiMap<V, K> inverseBidiMap) {
protected DualHashBidiMap(final Map<K, V> normalMap, final Map<V, K> reverseMap,
final BidiMap<V, K> inverseBidiMap) {
super(normalMap, reverseMap, inverseBidiMap);
}
@ -82,7 +83,8 @@ public class DualHashBidiMap<K, V> extends AbstractDualBidiMap<K, V> implements
* @return new bidi map
*/
@Override
protected BidiMap<V, K> createBidiMap(final Map<V, K> normalMap, final Map<K, V> reverseMap, final BidiMap<K, V> inverseBidiMap) {
protected BidiMap<V, K> createBidiMap(final Map<V, K> normalMap, final Map<K, V> reverseMap,
final BidiMap<K, V> inverseBidiMap) {
return new DualHashBidiMap<V, K>(normalMap, reverseMap, inverseBidiMap);
}

View File

@ -105,7 +105,8 @@ public class DualTreeBidiMap<K, V> extends AbstractDualBidiMap<K, V>
* @param reverseMap the reverse direction map
* @param inverseBidiMap the inverse BidiMap
*/
protected DualTreeBidiMap(final Map<K, V> normalMap, final Map<V, K> reverseMap, final BidiMap<V, K> inverseBidiMap) {
protected DualTreeBidiMap(final Map<K, V> normalMap, final Map<V, K> reverseMap,
final BidiMap<V, K> inverseBidiMap) {
super(normalMap, reverseMap, inverseBidiMap);
this.comparator = ((SortedMap<K, V>) normalMap).comparator();
this.valueComparator = ((SortedMap<V, K>) reverseMap).comparator();
@ -120,7 +121,8 @@ public class DualTreeBidiMap<K, V> extends AbstractDualBidiMap<K, V>
* @return new bidi map
*/
@Override
protected DualTreeBidiMap<V, K> createBidiMap(final Map<V, K> normalMap, final Map<K, V> reverseMap, final BidiMap<K, V> inverseMap) {
protected DualTreeBidiMap<V, K> createBidiMap(final Map<V, K> normalMap, final Map<K, V> reverseMap,
final BidiMap<K, V> inverseMap) {
return new DualTreeBidiMap<V, K>(normalMap, reverseMap, inverseMap);
}

View File

@ -73,7 +73,8 @@ public class IndexedCollection<K, C> extends AbstractCollectionDecorator<C> {
* @param keyTransformer {@link Transformer} for generating index keys
* @param map map to use as index
*/
public IndexedCollection(final Collection<C> coll, final Transformer<C, K> keyTransformer, final HashMap<K, C> map) {
public IndexedCollection(final Collection<C> coll, final Transformer<C, K> keyTransformer,
final HashMap<K, C> map) {
super(coll);
this.keyTransformer = keyTransformer;
this.index = new HashMap<K, C>();

View File

@ -58,7 +58,7 @@ public class TransformedCollection<E> extends AbstractCollectionDecorator<E> {
* @throws IllegalArgumentException if collection or transformer is null
*/
public static <E> TransformedCollection<E> transformingCollection(final Collection<E> coll,
final Transformer<? super E, ? extends E> transformer) {
final Transformer<? super E, ? extends E> transformer) {
return new TransformedCollection<E>(coll, transformer);
}
@ -78,7 +78,8 @@ public class TransformedCollection<E> extends AbstractCollectionDecorator<E> {
* @since 3.3
*/
public static <E> TransformedCollection<E> transformedCollection(final Collection<E> collection,
final Transformer<? super E, ? extends E> transformer) {
final Transformer<? super E, ? extends E> transformer) {
final TransformedCollection<E> decorated = new TransformedCollection<E>(collection, transformer);
// null collection & transformer are disallowed by the constructor call above
if (collection.size() > 0) {

View File

@ -63,7 +63,8 @@ public class TransformingComparator<E> implements Comparator<E>, Serializable {
* @param transformer what will transform the arguments to <code>compare</code>
* @param decorated the decorated Comparator
*/
public TransformingComparator(final Transformer<? super E, ? extends E> transformer, final Comparator<E> decorated) {
public TransformingComparator(final Transformer<? super E, ? extends E> transformer,
final Comparator<E> decorated) {
this.decorated = decorated;
this.transformer = transformer;
}

View File

@ -45,7 +45,8 @@ public final class AndPredicate<T> implements Predicate<T>, PredicateDecorator<T
* @return the <code>and</code> predicate
* @throws IllegalArgumentException if either predicate is null
*/
public static <T> Predicate<T> andPredicate(final Predicate<? super T> predicate1, final Predicate<? super T> predicate2) {
public static <T> Predicate<T> andPredicate(final Predicate<? super T> predicate1,
final Predicate<? super T> predicate2) {
if (predicate1 == null || predicate2 == null) {
throw new IllegalArgumentException("Predicate must not be null");
}

View File

@ -298,7 +298,8 @@ public class TreeList<E> extends AbstractList<E> {
* @param rightFollower the node with the value following this one
* @param leftFollower the node with the value leading this one
*/
private AVLNode(final int relativePosition, final E obj, final AVLNode<E> rightFollower, final AVLNode<E> leftFollower) {
private AVLNode(final int relativePosition, final E obj,
final AVLNode<E> rightFollower, final AVLNode<E> leftFollower) {
this.relativePosition = relativePosition;
value = obj;
rightIsNext = true;

View File

@ -489,7 +489,8 @@ public class AbstractHashedMap<K, V> extends AbstractMap<K, V> implements Iterab
* @param key the key to add
* @param value the value to add
*/
protected void reuseEntry(final HashEntry<K, V> entry, final int hashIndex, final int hashCode, final K key, final V value) {
protected void reuseEntry(final HashEntry<K, V> entry, final int hashIndex, final int hashCode,
final K key, final V value) {
entry.next = data[hashIndex];
entry.hashCode = hashCode;
entry.key = key;

View File

@ -168,7 +168,8 @@ abstract class AbstractInputCheckedMapDecorator<K, V>
/** The parent map */
private final AbstractInputCheckedMapDecorator<K, V> parent;
protected EntrySetIterator(final Iterator<Map.Entry<K, V>> iterator, final AbstractInputCheckedMapDecorator<K, V> parent) {
protected EntrySetIterator(final Iterator<Map.Entry<K, V>> iterator,
final AbstractInputCheckedMapDecorator<K, V> parent) {
super(iterator);
this.parent = parent;
}

View File

@ -467,7 +467,8 @@ public abstract class AbstractReferenceMap<K, V> extends AbstractHashedMap<K, V>
* @return the newly created entry
*/
@Override
protected ReferenceEntry<K, V> createEntry(final HashEntry<K, V> next, final int hashCode, final K key, final V value) {
protected ReferenceEntry<K, V> createEntry(final HashEntry<K, V> next, final int hashCode,
final K key, final V value) {
return new ReferenceEntry<K, V>(this, next, hashCode, key, value);
}
@ -601,7 +602,8 @@ public abstract class AbstractReferenceMap<K, V> extends AbstractHashedMap<K, V>
* @param key the key
* @param value the value
*/
public ReferenceEntry(final AbstractReferenceMap<K, V> parent, final HashEntry<K, V> next, final int hashCode, final K key, final V value) {
public ReferenceEntry(final AbstractReferenceMap<K, V> parent, final HashEntry<K, V> next,
final int hashCode, final K key, final V value) {
super(next, hashCode, null, null);
this.parent = parent;
this.key = toReference(parent.keyType, key, hashCode);

View File

@ -120,7 +120,8 @@ public class DefaultedMap<K, V> extends AbstractMapDecorator<K, V> implements Se
* @return a new defaulting map
* @throws IllegalArgumentException if map or factory is null
*/
public static <K, V> Map<K, V> defaultedMap(final Map<K, V> map, final Transformer<? super K, ? extends V> transformer) {
public static <K, V> Map<K, V> defaultedMap(final Map<K, V> map,
final Transformer<? super K, ? extends V> transformer) {
if (transformer == null) {
throw new IllegalArgumentException("Transformer must not be null");
}

View File

@ -136,7 +136,8 @@ public class IdentityMap<K, V>
* @return the newly created entry
*/
@Override
protected IdentityEntry<K, V> createEntry(final HashEntry<K, V> next, final int hashCode, final K key, final V value) {
protected IdentityEntry<K, V> createEntry(final HashEntry<K, V> next, final int hashCode,
final K key, final V value) {
return new IdentityEntry<K, V>(next, hashCode, key, value);
}

View File

@ -293,7 +293,8 @@ public class LRUMap<K, V>
* @param key the key to add
* @param value the value to add
*/
protected void reuseMapping(final LinkEntry<K, V> entry, final int hashIndex, final int hashCode, final K key, final V value) {
protected void reuseMapping(final LinkEntry<K, V> entry, final int hashIndex, final int hashCode,
final K key, final V value) {
// find the entry before the entry specified in the hash table
// remember that the parameters (except the first) refer to the new entry,
// not the old one

View File

@ -73,7 +73,8 @@ public class LazySortedMap<K,V>
* @return a new lazy sorted map
* @throws IllegalArgumentException if map or factory is null
*/
public static <K, V> LazySortedMap<K, V> lazySortedMap(final SortedMap<K, V> map, final Factory<? extends V> factory) {
public static <K, V> LazySortedMap<K, V> lazySortedMap(final SortedMap<K, V> map,
final Factory<? extends V> factory) {
return new LazySortedMap<K,V>(map, factory);
}

View File

@ -572,7 +572,8 @@ public class MultiKeyMap<K, V> extends AbstractMapDecorator<MultiKey<? extends K
* @param key5 the fifth key
* @return true if the map contains the key
*/
public boolean containsKey(final Object key1, final Object key2, final Object key3, final Object key4, final Object key5) {
public boolean containsKey(final Object key1, final Object key2, final Object key3,
final Object key4, final Object key5) {
final int hashCode = hash(key1, key2, key3, key4, key5);
AbstractHashedMap.HashEntry<MultiKey<? extends K>, V> entry =
decorated().data[decorated().hashIndex(hashCode, decorated().data.length)];

View File

@ -110,7 +110,7 @@ public class MultiValueMap<K, V> extends AbstractMapDecorator<K, Object> impleme
* @return a new multi-value map
*/
public static <K, V, C extends Collection<V>> MultiValueMap<K, V> multiValueMap(final Map<K, ? super C> map,
final Factory<C> collectionFactory) {
final Factory<C> collectionFactory) {
return new MultiValueMap<K, V>(map, collectionFactory);
}
@ -132,7 +132,8 @@ public class MultiValueMap<K, V> extends AbstractMapDecorator<K, Object> impleme
* @param collectionFactory the collection factory which must return a Collection instance
*/
@SuppressWarnings("unchecked")
protected <C extends Collection<V>> MultiValueMap(final Map<K, ? super C> map, final Factory<C> collectionFactory) {
protected <C extends Collection<V>> MultiValueMap(final Map<K, ? super C> map,
final Factory<C> collectionFactory) {
super((Map<K, Object>) map);
if (collectionFactory == null) {
throw new IllegalArgumentException("The factory must not be null");

View File

@ -89,7 +89,8 @@ public class PredicatedMap<K, V>
* @param valuePredicate the predicate to validate to values, null means no check
* @throws IllegalArgumentException if the map is null
*/
protected PredicatedMap(final Map<K, V> map, final Predicate<? super K> keyPredicate, final Predicate<? super V> valuePredicate) {
protected PredicatedMap(final Map<K, V> map, final Predicate<? super K> keyPredicate,
final Predicate<? super V> valuePredicate) {
super(map);
this.keyPredicate = keyPredicate;
this.valuePredicate = valuePredicate;

View File

@ -88,7 +88,9 @@ public class TransformedSortedMap<K, V>
public static <K, V> TransformedSortedMap<K, V> transformedSortedMap(final SortedMap<K, V> map,
final Transformer<? super K, ? extends K> keyTransformer,
final Transformer<? super V, ? extends V> valueTransformer) {
final TransformedSortedMap<K, V> decorated = new TransformedSortedMap<K, V>(map, keyTransformer, valueTransformer);
final TransformedSortedMap<K, V> decorated =
new TransformedSortedMap<K, V>(map, keyTransformer, valueTransformer);
if (map.size() > 0) {
final Map<K, V> transformed = decorated.transformMap(map);
decorated.clear();

View File

@ -55,7 +55,8 @@ public class PredicatedSortedSet<E> extends PredicatedSet<E> implements SortedSe
* @throws IllegalArgumentException if set or predicate is null
* @throws IllegalArgumentException if the set contains invalid elements
*/
public static <E> PredicatedSortedSet<E> predicatedSortedSet(final SortedSet<E> set, final Predicate<? super E> predicate) {
public static <E> PredicatedSortedSet<E> predicatedSortedSet(final SortedSet<E> set,
final Predicate<? super E> predicate) {
return new PredicatedSortedSet<E>(set, predicate);
}

View File

@ -52,7 +52,8 @@ public class TransformedSet<E> extends TransformedCollection<E> implements Set<E
* @return a new transformed set
* @throws IllegalArgumentException if set or transformer is null
*/
public static <E> TransformedSet<E> transformingSet(final Set<E> set, final Transformer<? super E, ? extends E> transformer) {
public static <E> TransformedSet<E> transformingSet(final Set<E> set,
final Transformer<? super E, ? extends E> transformer) {
return new TransformedSet<E>(set, transformer);
}

View File

@ -53,7 +53,7 @@ public class TransformedSortedSet<E> extends TransformedSet<E> implements Sorted
* @throws IllegalArgumentException if set or transformer is null
*/
public static <E> TransformedSortedSet<E> transformingSortedSet(final SortedSet<E> set,
final Transformer<? super E, ? extends E> transformer) {
final Transformer<? super E, ? extends E> transformer) {
return new TransformedSortedSet<E>(set, transformer);
}
@ -73,7 +73,8 @@ public class TransformedSortedSet<E> extends TransformedSet<E> implements Sorted
* @since 3.3
*/
public static <E> TransformedSortedSet<E> transformedSortedSet(final SortedSet<E> set,
final Transformer<? super E, ? extends E> transformer) {
final Transformer<? super E, ? extends E> transformer) {
final TransformedSortedSet<E> decorated = new TransformedSortedSet<E>(set, transformer);
if (transformer != null && set != null && set.size() > 0) {
@SuppressWarnings("unchecked") // set is type E

View File

@ -615,7 +615,7 @@ abstract class PatriciaTrieBase<K, V> extends AbstractTrie<K, V> {
if (child.bitIndex > parent.bitIndex) {
child.parent = parent;
}
};
}
// Fix H's parent and child Nodes
{
@ -635,7 +635,7 @@ abstract class PatriciaTrieBase<K, V> extends AbstractTrie<K, V> {
} else {
h.parent.right = p;
}
};
}
// Copy the remaining fields from H to P
//p.bitIndex = h.bitIndex;