This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new 97a91d1321 Trivial refactor: replace with switch expression
97a91d1321 is described below

commit 97a91d1321016a3ec323d5408acec83a9c41b4cd
Author: Daniel Sun <[email protected]>
AuthorDate: Mon Apr 13 02:09:35 2026 +0900

    Trivial refactor: replace with switch expression
---
 .../groovy/grape/ivy/PlatformLoggingMessageLogger.java   | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git 
a/subprojects/groovy-grape-ivy/src/main/java/groovy/grape/ivy/PlatformLoggingMessageLogger.java
 
b/subprojects/groovy-grape-ivy/src/main/java/groovy/grape/ivy/PlatformLoggingMessageLogger.java
index da1ede1ee7..256deb611a 100644
--- 
a/subprojects/groovy-grape-ivy/src/main/java/groovy/grape/ivy/PlatformLoggingMessageLogger.java
+++ 
b/subprojects/groovy-grape-ivy/src/main/java/groovy/grape/ivy/PlatformLoggingMessageLogger.java
@@ -81,13 +81,13 @@ class PlatformLoggingMessageLogger extends 
AbstractMessageLogger {
     }
 
     private static System.Logger.Level toSystemLevel(int ivyLevel) {
-        switch (ivyLevel) {
-            case Message.MSG_ERR:     return ERROR;
-            case Message.MSG_WARN:    return WARNING;
-            case Message.MSG_INFO:    return INFO;
-            case Message.MSG_VERBOSE: return DEBUG;
-            case Message.MSG_DEBUG:   return TRACE;
-            default:                  return INFO;
-        }
+        return switch (ivyLevel) {
+            case Message.MSG_ERR -> ERROR;
+            case Message.MSG_WARN -> WARNING;
+            case Message.MSG_INFO -> INFO;
+            case Message.MSG_VERBOSE -> DEBUG;
+            case Message.MSG_DEBUG -> TRACE;
+            default -> INFO;
+        };
     }
 }

Reply via email to