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:43 UTC

[groovy] branch danielsun/tweak-print-switchstmt created (now 0d0bba5)

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

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


      at 0d0bba5  Tweak printing switch statement

This branch includes the following new commits:

     new 0d0bba5  Tweak printing switch statement

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[groovy] 01/01: Tweak printing switch statement

Posted by su...@apache.org.
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