activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuconic <...@git.apache.org>
Subject [GitHub] activemq-artemis pull request #1366: ARTEMIS-1252 Add service loading of pas...
Date Mon, 26 Jun 2017 18:53:22 GMT
Github user clebertsuconic commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1366#discussion_r124090489
  
    --- Diff: artemis-commons/src/main/java/org/apache/activemq/artemis/utils/PasswordMaskingUtil.java
---
    @@ -108,22 +110,29 @@ public static HashProcessor getHashProcessor() {
     
           // semi colons
           String[] parts = codecDesc.split(";");
    -
           if (parts.length < 1)
              throw new ActiveMQException(ActiveMQExceptionType.ILLEGAL_STATE, "Invalid PasswordCodec
value: " + codecDesc);
     
           final String codecClassName = parts[0];
     
           // load class
    -      codecInstance = AccessController.doPrivileged(new PrivilegedAction<SensitiveDataCodec<String>>()
{
    -         @Override
    -         public SensitiveDataCodec<String> run() {
    -            ClassLoader loader = Thread.currentThread().getContextClassLoader();
    +      codecInstance = AccessController.doPrivileged((PrivilegedAction<SensitiveDataCodec<String>>)
() -> {
    +         ServiceLoader<SensitiveDataCodec> serviceLoader = ServiceLoader.load(SensitiveDataCodec.class,
PasswordMaskingUtil.class.getClassLoader());
    --- End diff --
    
    Looks like a nice feature.. but no tests?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message