coheigea commented on code in PR #181:
URL: 
https://github.com/apache/santuario-xml-security-java/pull/181#discussion_r1238086926


##########
src/main/java/org/apache/xml/security/stax/impl/processor/output/AbstractEncryptOutputProcessor.java:
##########
@@ -160,7 +160,7 @@ public void init(OutputProcessorChain outputProcessorChain) 
throws XMLSecurityEx
             String encryptionSymAlgorithm = 
securityProperties.getEncryptionSymAlgorithm();
             try {
                 //initialize the cipher
-                String jceAlgorithm = 
JCEAlgorithmMapper.translateURItoJCEID(encryptionSymAlgorithm);
+                String jceAlgorithm = 
JCEMapper.translateURItoJCEID(encryptionSymAlgorithm);

Review Comment:
   Was this change intended?



##########
src/main/java/org/apache/jcp/xml/dsig/internal/dom/DOMSignedInfo.java:
##########
@@ -100,17 +100,13 @@ public DOMSignedInfo(CanonicalizationMethod cm, 
SignatureMethod sm,
         }
         this.canonicalizationMethod = cm;
         this.signatureMethod = sm;
-        this.references = Collections.unmodifiableList(
-            new ArrayList<>(references));
+        this.references = Collections.unmodifiableList(new 
ArrayList<>(references));
         if (this.references.isEmpty()) {
-            throw new IllegalArgumentException("list of references must " +
-                "contain at least one entry");
+            throw new IllegalArgumentException("list of references must 
contain at least one entry");
         }
-        for (int i = 0, size = this.references.size(); i < size; i++) {
-            Object obj = this.references.get(i);
-            if (!(obj instanceof Reference)) {
-                throw new ClassCastException("list of references contains " +
-                    "an illegal type");
+        for (Object obj : this.references) {
+            if (!Reference.class.isInstance(obj)) {

Review Comment:
   According to https://rules.sonarsource.com/java/RSPEC-6202, the isInstance 
operator is preferred when the class name is known at compile time.



##########
src/main/java/org/apache/xml/security/stax/impl/processor/output/AbstractSignatureOutputProcessor.java:
##########
@@ -181,8 +182,8 @@ protected void setActiveInternalSignatureOutputProcessor(
     protected DigestOutputStream createMessageDigestOutputStream(String 
digestAlgorithm)
             throws XMLSecurityException {
 
-        String jceName = 
JCEAlgorithmMapper.translateURItoJCEID(digestAlgorithm);
-        String jceProvider = 
JCEAlgorithmMapper.getJCEProviderFromURI(digestAlgorithm);
+        String jceName = JCEMapper.translateURItoJCEID(digestAlgorithm);
+        String jceProvider = JCEMapper.getJCEProviderFromURI(digestAlgorithm);

Review Comment:
   Why this change?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to