gemmellr commented on a change in pull request #3851:
URL: https://github.com/apache/activemq-artemis/pull/3851#discussion_r749243029



##########
File path: 
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/DefaultSensitiveStringCodec.java
##########
@@ -79,6 +79,21 @@ public void init(Map<String, String> params) throws 
Exception {
       }
    }
 
+   @Override
+   public boolean compare(Object value, Object encodedValue) {
+      if (encodedValue instanceof String == false) {
+         throw new IllegalArgumentException("Not supported encodedValue type: 
" + encodedValue.getClass().getName());
+      }
+
+      if (value instanceof String) {
+         return verify(((String)value).toCharArray(), (String)encodedValue);
+      } else if (value instanceof char[]) {
+         return verify((char[])value, (String)encodedValue);
+      } else {
+         throw new IllegalArgumentException("Not supported value type: " + 
value.getClass().getName());

Review comment:
       Could NPE on the value.getClass(). Same comment on "Unsupported" (or 
perhaps "Unexpected")




-- 
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