Tab police
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1299233 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d4747e7edc
commit
92e8f95b6a
|
@ -192,7 +192,7 @@ public class TransformerUtils {
|
|||
* @throws IllegalArgumentException if either transformer is null
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> Transformer<T, T> chainedTransformer(
|
||||
public static <T> Transformer<T, T> chainedTransformer(
|
||||
Transformer<? super T, ? extends T> transformer1,
|
||||
Transformer<? super T, ? extends T> transformer2) {
|
||||
return ChainedTransformer.<T> chainedTransformer(transformer1, transformer2);
|
||||
|
|
|
@ -80,7 +80,7 @@ public class TransformedBag<E>
|
|||
@SuppressWarnings("unchecked") // Bag is of type E
|
||||
E[] values = (E[]) bag.toArray();
|
||||
bag.clear();
|
||||
for (int i = 0; i < values.length; i++) {
|
||||
for (int i = 0; i < values.length; i++) {
|
||||
decorated.decorated().add(transformer.transform(values[i]));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -102,8 +102,8 @@ public final class UnmodifiableBag<E>
|
|||
//-----------------------------------------------------------------------
|
||||
@Override
|
||||
public Iterator<E> iterator() {
|
||||
return UnmodifiableIterator.<E> unmodifiableIterator(decorated()
|
||||
.iterator());
|
||||
return UnmodifiableIterator.<E> unmodifiableIterator(decorated()
|
||||
.iterator());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -150,7 +150,7 @@ public final class UnmodifiableBag<E>
|
|||
@Override
|
||||
public Set<E> uniqueSet() {
|
||||
Set<E> set = decorated().uniqueSet();
|
||||
return UnmodifiableSet.<E> unmodifiableSet(set);
|
||||
return UnmodifiableSet.<E> unmodifiableSet(set);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ public final class UnmodifiableBoundedCollection<E> extends AbstractCollectionDe
|
|||
* @throws IllegalArgumentException if bag is null
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <E> BoundedCollection<E> unmodifiableBoundedCollection(Collection<? extends E> coll) {
|
||||
public static <E> BoundedCollection<E> unmodifiableBoundedCollection(Collection<? extends E> coll) {
|
||||
if (coll == null) {
|
||||
throw new IllegalArgumentException("The collection must not be null");
|
||||
}
|
||||
|
|
|
@ -24,43 +24,43 @@ package org.apache.commons.collections.functors;
|
|||
* @version $Revision$
|
||||
*/
|
||||
public class DefaultEquator<T> implements Equator<T> {
|
||||
/** Static instance */
|
||||
public static final DefaultEquator<Object> INSTANCE = new DefaultEquator<Object>();
|
||||
/** Static instance */
|
||||
public static final DefaultEquator<Object> INSTANCE = new DefaultEquator<Object>();
|
||||
|
||||
/**
|
||||
* Hashcode used for <code>null</code> objects.
|
||||
*/
|
||||
public static final int HASHCODE_NULL = -1;
|
||||
/**
|
||||
* Hashcode used for <code>null</code> objects.
|
||||
*/
|
||||
public static final int HASHCODE_NULL = -1;
|
||||
|
||||
/**
|
||||
* {@inheritDoc} Delegates to {@link Object#equals(Object)}.
|
||||
*/
|
||||
public boolean equate(T o1, T o2) {
|
||||
return o1 == o2 || o1 != null && o1.equals(o2);
|
||||
}
|
||||
/**
|
||||
* {@inheritDoc} Delegates to {@link Object#equals(Object)}.
|
||||
*/
|
||||
public boolean equate(T o1, T o2) {
|
||||
return o1 == o2 || o1 != null && o1.equals(o2);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @return <code>o.hashCode()</code> if <code>o</code> is non-
|
||||
* <code>null</code>, else {@link #HASHCODE_NULL}.
|
||||
*/
|
||||
public int hash(T o) {
|
||||
return o == null ? HASHCODE_NULL : o.hashCode();
|
||||
}
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @return <code>o.hashCode()</code> if <code>o</code> is non-
|
||||
* <code>null</code>, else {@link #HASHCODE_NULL}.
|
||||
*/
|
||||
public int hash(T o) {
|
||||
return o == null ? HASHCODE_NULL : o.hashCode();
|
||||
}
|
||||
|
||||
private Object readResolve() {
|
||||
return INSTANCE;
|
||||
}
|
||||
private Object readResolve() {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a typed {@link DefaultEquator} instance.
|
||||
*
|
||||
* @param <T>
|
||||
* @return {@link DefaultEquator#INSTANCE}
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> DefaultEquator<T> defaultEquator() {
|
||||
return (DefaultEquator<T>) DefaultEquator.INSTANCE;
|
||||
}
|
||||
/**
|
||||
* Get a typed {@link DefaultEquator} instance.
|
||||
*
|
||||
* @param <T>
|
||||
* @return {@link DefaultEquator#INSTANCE}
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> DefaultEquator<T> defaultEquator() {
|
||||
return (DefaultEquator<T>) DefaultEquator.INSTANCE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -510,8 +510,8 @@ public class TestLRUMap<K, V> extends AbstractTestOrderedMap<K, V> {
|
|||
}
|
||||
synchronized (map) {
|
||||
for (MapIterator<Object, Thread> iter = map.mapIterator(); iter.hasNext();) {
|
||||
iter.next();
|
||||
if (iter.getValue() == this) {
|
||||
iter.next();
|
||||
if (iter.getValue() == this) {
|
||||
iter.remove();
|
||||
}
|
||||
}
|
||||
|
@ -676,8 +676,8 @@ public class TestLRUMap<K, V> extends AbstractTestOrderedMap<K, V> {
|
|||
}
|
||||
synchronized (map) {
|
||||
for (Iterator<Object> iter = map.keySet().iterator(); iter.hasNext();) {
|
||||
String name = (String) iter.next();
|
||||
if (name.substring(0, name.indexOf('[')).equals(getName())) {
|
||||
String name = (String) iter.next();
|
||||
if (name.substring(0, name.indexOf('[')).equals(getName())) {
|
||||
iter.remove();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue