diff --git a/spring-core/src/main/java/org/springframework/core/CollectionFactory.java b/spring-core/src/main/java/org/springframework/core/CollectionFactory.java index f9cd5082d3..368a2e9dd3 100644 --- a/spring-core/src/main/java/org/springframework/core/CollectionFactory.java +++ b/spring-core/src/main/java/org/springframework/core/CollectionFactory.java @@ -105,7 +105,7 @@ public abstract class CollectionFactory { * @see java.util.ArrayList * @see java.util.LinkedList */ - @SuppressWarnings({ "unchecked", "cast" }) + @SuppressWarnings({ "unchecked", "cast", "rawtypes" }) public static Collection createApproximateCollection(Object collection, int capacity) { if (collection instanceof LinkedList) { return new LinkedList(); @@ -115,6 +115,7 @@ public abstract class CollectionFactory { } else if (collection instanceof EnumSet) { // superfluous cast necessary for bug in Eclipse 4.4.1. + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=454644 return (Collection) EnumSet.copyOf((EnumSet) collection); } else if (collection instanceof SortedSet) { @@ -150,7 +151,7 @@ public abstract class CollectionFactory { * @see java.util.EnumSet * @see java.util.ArrayList */ - @SuppressWarnings({ "unchecked", "cast" }) + @SuppressWarnings({ "unchecked", "cast", "rawtypes" }) public static Collection createCollection(Class collectionClass, Class elementType, int capacity) { if (collectionClass.isInterface()) { if (Set.class.equals(collectionClass) || Collection.class.equals(collectionClass)) { @@ -169,6 +170,7 @@ public abstract class CollectionFactory { else if (EnumSet.class.equals(collectionClass)) { Assert.notNull(elementType, "Cannot create EnumSet for unknown element type"); // superfluous cast necessary for bug in Eclipse 4.4.1. + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=454644 return (Collection) EnumSet.noneOf((Class) elementType); } else {