KevinWikant commented on PR #4563:
URL: https://github.com/apache/hadoop/pull/4563#issuecomment-1193994496

   ## RetryPolicies - RedundantModifier
   
   ```
   
./hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/retry/RetryPolicies.java:602:
    public OtherThanRemoteAndSaslExceptionDependentRetry(RetryPolicy 
defaultPolicy,:5: Redundant 'public' modifier. [RedundantModifier]
   ```
   
   Correcting this checkstyle issue because I am touching this line anyway
   
   
   ## RetryPolicies - EmptyBlock
   
   ```
   
./hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/retry/RetryPolicies.java:614:
      if (e instanceof RemoteException || isSaslFailure(e)) {:61: Must have at 
least one statement. [EmptyBlock]
   ```
   
   The code had the empty block before the change:
   
   ```
         if (e instanceof RemoteException || isSaslFailure(e)) {
           // do nothing
         } else {
   ```
   
   Will refactor this because required change is minimal
   
   
   ## SaslRpcClient - Indentation
   
   ```
   
./hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslRpcClient.java:240:
        final String serverPrincipal;: 'block' child has incorrect indentation 
level 8, expected level should be 6. [Indentation]
   
./hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslRpcClient.java:241:
        try {: 'try' has incorrect indentation level 8, expected level should 
be 6. [Indentation]
   
./hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslRpcClient.java:242:
          serverPrincipal = getServerPrincipal(authType);: 'try' child has 
incorrect indentation level 10, expected level should be 8. [Indentation]
   
./hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslRpcClient.java:243:
        } catch (IllegalArgumentException ex) {: 'try rcurly' has incorrect 
indentation level 8, expected level should be 6. [Indentation]
   
./hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslRpcClient.java:246:
          throw new SaslException("Bad Kerberos server principal 
configuration", ex);: 'catch' child has incorrect indentation level 10, 
expected level should be 8. [Indentation]
   
./hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslRpcClient.java:247:
        }: 'catch rcurly' has incorrect indentation level 8, expected level 
should be 6. [Indentation]
   ```
   
   This is what the code looks like after applying this checkstyle rule:
   
   ```
         case KERBEROS: {
           if (ugi.getRealAuthenticationMethod().getAuthMethod() !=
               AuthMethod.KERBEROS) {
             LOG.debug("client isn't using kerberos");
             return null;
           }
         final String serverPrincipal;
         try {
           serverPrincipal = getServerPrincipal(authType);
         } catch (IllegalArgumentException ex) {
           // YARN-11210: getServerPrincipal can throw IllegalArgumentException 
if Kerberos
           // configuration is bad, this is surfaced as a non-retryable 
SaslException
           throw new SaslException("Bad Kerberos server principal 
configuration", ex);
         }
           if (serverPrincipal == null) {
             LOG.debug("protocol doesn't use kerberos");
             return null;
           }
   ```
   
   Not sure why its recommending this indentation level, but it doesn't align 
with the way this code is currently structured. Going to recommend leaving this
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to