jdk/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureProperties.java
changeset 27747 3a271dc8b758
parent 25859 3317bb8137f4
child 32003 acb12269398a
--- a/jdk/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureProperties.java	Fri Nov 21 16:05:11 2014 +0100
+++ b/jdk/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureProperties.java	Fri Nov 21 15:23:36 2014 -0500
@@ -69,18 +69,15 @@
     {
         if (properties == null) {
             throw new NullPointerException("properties cannot be null");
-        } else if (properties.isEmpty()) {
+        }
+        List<SignatureProperty> tempList =
+            Collections.checkedList(new ArrayList<SignatureProperty>(),
+                                    SignatureProperty.class);
+        tempList.addAll(properties);
+        if (tempList.isEmpty()) {
             throw new IllegalArgumentException("properties cannot be empty");
-        } else {
-            this.properties = Collections.unmodifiableList(
-                new ArrayList<SignatureProperty>(properties));
-            for (int i = 0, size = this.properties.size(); i < size; i++) {
-                if (!(this.properties.get(i) instanceof SignatureProperty)) {
-                    throw new ClassCastException
-                        ("properties["+i+"] is not a valid type");
-                }
-            }
         }
+        this.properties = Collections.unmodifiableList(tempList);
         this.id = id;
     }