matthiasblaesing commented on code in PR #7367:
URL: https://github.com/apache/netbeans/pull/7367#discussion_r1594430864


##########
extide/gradle/src/org/netbeans/modules/gradle/spi/newproject/GradleInitWizard.java:
##########
@@ -49,10 +51,11 @@ public enum GradleDSL {
 
         @Override
         public String toString() {
-            return switch(this) {
-                case GROOVY -> Bundle.LBL_DSL_GROOVY();
-                case KOTLIN -> Bundle.LBL_DSL_KOTLIN();
-            };
+            switch(this) {
+                case GROOVY: return Bundle.LBL_DSL_GROOVY();
+                case KOTLIN: return Bundle.LBL_DSL_KOTLIN();
+                default: throw new IllegalStateException("update switch");

Review Comment:
   I would not throw from toString - if this is user visible the name might 
look strange, but still conveys the meaning.
   
   ```suggestion
                   default: return name();
   ```



##########
extide/gradle/src/org/netbeans/modules/gradle/spi/newproject/GradleInitWizard.java:
##########
@@ -88,16 +91,17 @@ public String getId() {
         
         @Override
         public String toString() {
-            return switch(this) {
-                case CPP_TEST -> Bundle.LBL_TFW_CPP_TEST();
-                case JUNIT -> Bundle.LBL_TFW_JUNIT();
-                case JUNIT_5 -> Bundle.LBL_TFW_JUNIT_5();
-                case KOTLIN_TEST -> Bundle.LBL_TFW_KOTLIN_TEST();
-                case SCALA_TEST -> Bundle.LBL_TFW_SCALA_TEST();
-                case SPOCK -> Bundle.LBL_TFW_SPOCK();
-                case TESTNG -> Bundle.LBL_TFW_TESTNG();
-                case XCTEST -> Bundle.LBL_TFW_XCTEST();
-            };
+            switch(this) {
+                case CPP_TEST: return Bundle.LBL_TFW_CPP_TEST();
+                case JUNIT: return Bundle.LBL_TFW_JUNIT();
+                case JUNIT_5: return Bundle.LBL_TFW_JUNIT_5();
+                case KOTLIN_TEST: return Bundle.LBL_TFW_KOTLIN_TEST();
+                case SCALA_TEST: return Bundle.LBL_TFW_SCALA_TEST();
+                case SPOCK: return Bundle.LBL_TFW_SPOCK();
+                case TESTNG: return Bundle.LBL_TFW_TESTNG();
+                case XCTEST: return Bundle.LBL_TFW_XCTEST();
+                default: throw new IllegalStateException("update switch");

Review Comment:
   ```suggestion
                   default: return name();
   ```



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