Github user kohlmu-pivotal commented on a diff in the pull request:

    https://github.com/apache/geode/pull/707#discussion_r132735527
  
    --- Diff: 
geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ServerConnectionFactory.java
 ---
    @@ -63,6 +65,31 @@ private static ClientProtocolMessageHandler 
findClientProtocolMessageHandler() {
         }
       }
     
    +  private static Class<? extends StreamAuthenticator> 
findStreamAuthenticator(
    +      String implementationID) {
    +    if (authenticatorClass != null) {
    +      return authenticatorClass;
    +    }
    +
    +    synchronized (streamAuthenticatorLoadLock) {
    +      if (authenticatorClass != null) {
    +        return authenticatorClass;
    +      }
    +
    +      ServiceLoader<StreamAuthenticator> loader = 
ServiceLoader.load(StreamAuthenticator.class);
    +
    +      for (StreamAuthenticator classInstance : loader) {
    +        if (implementationID.equals(classInstance.implementationID())) {
    +          return classInstance.getClass();
    --- End diff --
    
    Why do we get an instance of the StreamAuthenticator, just to call 
`getClass` on it, and then later we create a new instance of class from this 
instance. 


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to