You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/08/10 12:20:13 UTC

[GitHub] [ozone] fapifta opened a new pull request #2521: HDDS-5600. Allow nested blocks in switch case statements in checkstyle checks.

fapifta opened a new pull request #2521:
URL: https://github.com/apache/ozone/pull/2521


   ## What changes were proposed in this pull request?
   
   In the checkstyle rules, we enable the module AvoidNestedBlocks.
   
   This is a problem, if for example a variable scope needs to be created inside a switch case statement, where this rule gives a warning if a case defines a code block ("{}").
   
   This PR is to loosen this rule, and allow nested blocks in switch statements.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-5600
   
   ## How was this patch tested?
   Added a random test code with a switch case with blocks, and ran checkstyle, then removed the random code block.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] fapifta commented on pull request #2521: HDDS-5600. Allow nested blocks in switch case statements in checkstyle checks.

Posted by GitBox <gi...@apache.org>.
fapifta commented on pull request #2521:
URL: https://github.com/apache/ozone/pull/2521#issuecomment-896124501


   @adoroszlai I think you have pointed out really well why we do not want this change afterall...
   
   In case there is a need to have local variables and a code block, one can always define a method and call that from the case or default branch of the switch statement, and it is probably a way more better practice when the code inside the branch is complicated or longer. I am revoking the PR and will add this learning point of mine in the JIRA.
   Thank you for the reviews!


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] fapifta closed pull request #2521: HDDS-5600. Allow nested blocks in switch case statements in checkstyle checks.

Posted by GitBox <gi...@apache.org>.
fapifta closed pull request #2521:
URL: https://github.com/apache/ozone/pull/2521


   


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org