diff --git a/src/main/java/org/apache/commons/collections4/MultiMapUtils.java b/src/main/java/org/apache/commons/collections4/MultiMapUtils.java index be90de479..55f30f5e7 100644 --- a/src/main/java/org/apache/commons/collections4/MultiMapUtils.java +++ b/src/main/java/org/apache/commons/collections4/MultiMapUtils.java @@ -18,7 +18,6 @@ package org.apache.commons.collections4; import java.util.ArrayList; import java.util.Collection; -import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -150,7 +149,7 @@ public class MultiMapUtils { */ public static Set getSet(MultiValuedMap map, K key) { if (map != null) { - Collection col = map.get(key); + Collection col = map.get(key); if (col instanceof Set) { return (Set) col; } @@ -184,7 +183,7 @@ public class MultiMapUtils { // ----------------------------------------------------------------------- /** - * Creates a {@link ListValuedMap} with a {@link HashMap} as its internal storage. + * Creates a {@link ListValuedMap} with a {@link java.util.HashMap HashMap} as its internal storage. * * @param the key type * @param the value type @@ -195,7 +194,7 @@ public class MultiMapUtils { } /** - * Creates a {@link ListValuedMap} with a {@link HashMap} as its internal + * Creates a {@link ListValuedMap} with a {@link java.util.HashMap HashMap} as its internal * storage which maps the keys to list of type listClass. * * @param the key type @@ -209,7 +208,7 @@ public class MultiMapUtils { } /** - * Creates a {@link SetValuedMap} with a {@link HashMap} as its internal + * Creates a {@link SetValuedMap} with a {@link java.util.HashMap HashMap} as its internal * storage * * @param the key type @@ -221,7 +220,7 @@ public class MultiMapUtils { } /** - * Creates a {@link SetValuedMap} with a {@link HashMap} as its internal + * Creates a {@link SetValuedMap} with a {@link java.util.HashMap HashMap} as its internal * storage which maps the keys to a set of type setClass * * @param the key type diff --git a/src/main/java/org/apache/commons/collections4/multimap/MultiValuedLinkedHashMap.java b/src/main/java/org/apache/commons/collections4/multimap/MultiValuedLinkedHashMap.java index 9d4fae698..bee17a8d2 100644 --- a/src/main/java/org/apache/commons/collections4/multimap/MultiValuedLinkedHashMap.java +++ b/src/main/java/org/apache/commons/collections4/multimap/MultiValuedLinkedHashMap.java @@ -16,16 +16,22 @@ */ package org.apache.commons.collections4.multimap; -import java.util.*; +import java.util.Collection; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; import org.apache.commons.collections4.ListValuedMap; import org.apache.commons.collections4.MultiValuedMap; import org.apache.commons.collections4.SetValuedMap; /** - * Implements a {@link MultiValuedMap}, using a {@link LinkedHashMap} to provide data - * storage. This MultiValuedMap implementation the allows insertion order to be - * maintained. + * Implements a {@link MultiValuedMap}, using a {@link LinkedHashMap} to provide + * data storage. This MultiValuedMap implementation the allows insertion order + * to be maintained. *

* A MultiValuedMap is a Map with slightly different semantics. * Putting a value into the map will add the value to a Collection at that key. @@ -43,7 +49,7 @@ import org.apache.commons.collections4.SetValuedMap; * exceptions when accessed by concurrent threads without synchronization. * * @since 4.1 - * @version $Id$ + * @version $Id: $ */ public class MultiValuedLinkedHashMap extends AbstractMultiValuedMap implements MultiValuedMap { @@ -221,7 +227,8 @@ public class MultiValuedLinkedHashMap extends AbstractMultiValuedMap */ protected > MultiValuedLinkedHashMap(int initialCapacity, float loadFactor, final Class collectionClazz, int initialCollectionCapacity) { - super(new LinkedHashMap>(initialCapacity, loadFactor), collectionClazz, initialCollectionCapacity); + super(new LinkedHashMap>(initialCapacity, loadFactor), collectionClazz, + initialCollectionCapacity); } /** Inner class for ListValuedLinkedMap */ diff --git a/src/test/java/org/apache/commons/collections4/multimap/MultiValuedLinkedHashMapTest.java b/src/test/java/org/apache/commons/collections4/multimap/MultiValuedLinkedHashMapTest.java index 6951232a7..45c4cfd16 100644 --- a/src/test/java/org/apache/commons/collections4/multimap/MultiValuedLinkedHashMapTest.java +++ b/src/test/java/org/apache/commons/collections4/multimap/MultiValuedLinkedHashMapTest.java @@ -16,17 +16,25 @@ */ package org.apache.commons.collections4.multimap; -import java.util.*; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; +import java.util.Set; import junit.framework.Test; -import org.apache.commons.collections4.*; +import org.apache.commons.collections4.BulkTest; +import org.apache.commons.collections4.ListValuedMap; +import org.apache.commons.collections4.MapIterator; +import org.apache.commons.collections4.MultiValuedMap; +import org.apache.commons.collections4.SetValuedMap; /** * Test MultiValuedLinkedHashMap * * @since 4.1 - * @version $Id$ + * @version $Id: $ */ public class MultiValuedLinkedHashMapTest extends AbstractMultiValuedMapTest { @@ -47,8 +55,8 @@ public class MultiValuedLinkedHashMapTest extends AbstractMultiValuedMapTe public void testIterationOrder() { MultiValuedMap map = makeFullMap(); MapIterator mapIt = map.mapIterator(); - Iterator keyIt = Arrays.asList(getSampleKeys()).iterator(); - Iterator valueIt = Arrays.asList(getSampleValues()).iterator(); + Iterator keyIt = Arrays.asList(getSampleKeys()).iterator(); + Iterator valueIt = Arrays.asList(getSampleValues()).iterator(); while(mapIt.hasNext()) { mapIt.next(); @@ -114,8 +122,8 @@ public class MultiValuedLinkedHashMapTest extends AbstractMultiValuedMapTe addSampleMappings(setMap); MapIterator mapIt = setMap.mapIterator(); - Iterator keyIt = Arrays.asList(getSampleKeys()).iterator(); - Iterator valueIt = Arrays.asList(getSampleValues()).iterator(); + Iterator keyIt = Arrays.asList(getSampleKeys()).iterator(); + Iterator valueIt = Arrays.asList(getSampleValues()).iterator(); while(mapIt.hasNext()) { mapIt.next(); @@ -190,8 +198,8 @@ public class MultiValuedLinkedHashMapTest extends AbstractMultiValuedMapTe addSampleMappings(listMap); MapIterator mapIt = listMap.mapIterator(); - Iterator keyIt = Arrays.asList(getSampleKeys()).iterator(); - Iterator valueIt = Arrays.asList(getSampleValues()).iterator(); + Iterator keyIt = Arrays.asList(getSampleKeys()).iterator(); + Iterator valueIt = Arrays.asList(getSampleValues()).iterator(); while(mapIt.hasNext()) { mapIt.next();