mbien commented on code in PR #8265:
URL: https://github.com/apache/netbeans/pull/8265#discussion_r1992319805


##########
java/maven/src/org/netbeans/modules/maven/execute/AbstractOutputHandler.java:
##########
@@ -106,17 +102,15 @@ private boolean isProtectedWait(Project proj, RunConfig 
config) {
         if(action == null || proj == null || 
!RunUtils.isCompileOnSaveEnabled(proj)) {
             return false;
         }
-        switch(action) {
-            case ActionProvider.COMMAND_RUN: 
-            case ActionProvider.COMMAND_RUN_SINGLE:
-            case ActionProvider.COMMAND_DEBUG:
-            case ActionProvider.COMMAND_DEBUG_SINGLE:
-            case ActionProviderImpl.COMMAND_DEBUG_MAIN:
-            case ActionProviderImpl.COMMAND_RUN_MAIN:
-                return true;
-            default:
-                return false;
-        }
+        return switch (action) {

Review Comment:
   I somewhat agree that it doesn't look better in this particular case. Its 
still a bit less noisy so I thought I convert it.
   
   The main value is that switch expressions must be exhaustive, but this was 
easy enough to see in the original version too.



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

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to