You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2021/07/24 15:37:44 UTC

[groovy] 01/01: Tweak printing switch statement

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

sunlan pushed a commit to branch danielsun/tweak-print-switchstmt
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 0d0bba5be629efc3418e7c2a7113e7fb8a988a1e
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sat Jul 24 23:37:22 2021 +0800

    Tweak printing switch statement
---
 .../src/main/groovy/groovy/console/ui/AstNodeToScriptAdapter.groovy     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/subprojects/groovy-console/src/main/groovy/groovy/console/ui/AstNodeToScriptAdapter.groovy b/subprojects/groovy-console/src/main/groovy/groovy/console/ui/AstNodeToScriptAdapter.groovy
index c51c5b3..d1c3330 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/console/ui/AstNodeToScriptAdapter.groovy
+++ b/subprojects/groovy-console/src/main/groovy/groovy/console/ui/AstNodeToScriptAdapter.groovy
@@ -638,7 +638,7 @@ class AstNodeToScriptVisitor implements CompilationUnit.IPrimaryClassNodeOperati
             statement?.caseStatements?.each {
                 visitCaseStatement it
             }
-            if (statement?.defaultStatement) {
+            if (statement?.defaultStatement !instanceof EmptyStatement) {
                 print 'default: '
                 printLineBreak()
                 statement?.defaultStatement?.visit this