jdk/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignedInfo.java
equal
deleted
inserted
replaced
98 if (cm == null || sm == null || references == null) { |
98 if (cm == null || sm == null || references == null) { |
99 throw new NullPointerException(); |
99 throw new NullPointerException(); |
100 } |
100 } |
101 this.canonicalizationMethod = cm; |
101 this.canonicalizationMethod = cm; |
102 this.signatureMethod = sm; |
102 this.signatureMethod = sm; |
103 this.references = Collections.unmodifiableList( |
103 List<Reference> tempList = |
104 new ArrayList<Reference>(references)); |
104 Collections.checkedList(new ArrayList<Reference>(), |
105 if (this.references.isEmpty()) { |
105 Reference.class); |
106 throw new IllegalArgumentException("list of references must " + |
106 tempList.addAll(references); |
107 "contain at least one entry"); |
107 if (tempList.isEmpty()) { |
108 } |
108 throw new IllegalArgumentException("references cannot be empty"); |
109 for (int i = 0, size = this.references.size(); i < size; i++) { |
109 } |
110 Object obj = this.references.get(i); |
110 this.references = Collections.unmodifiableList(tempList); |
111 if (!(obj instanceof Reference)) { |
|
112 throw new ClassCastException("list of references contains " + |
|
113 "an illegal type"); |
|
114 } |
|
115 } |
|
116 } |
111 } |
117 |
112 |
118 /** |
113 /** |
119 * Creates a <code>DOMSignedInfo</code> from the specified parameters. |
114 * Creates a <code>DOMSignedInfo</code> from the specified parameters. |
120 * |
115 * |