You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2015/09/21 19:47:59 UTC

incubator-groovy git commit: GROOVY-7592: default does not have to be the last label in switch/case statements

Repository: incubator-groovy
Updated Branches:
  refs/heads/master cfcbeed55 -> 5d4f7b46e


GROOVY-7592: default does not have to be the last label in switch/case statements


Project: http://git-wip-us.apache.org/repos/asf/incubator-groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-groovy/commit/5d4f7b46
Tree: http://git-wip-us.apache.org/repos/asf/incubator-groovy/tree/5d4f7b46
Diff: http://git-wip-us.apache.org/repos/asf/incubator-groovy/diff/5d4f7b46

Branch: refs/heads/master
Commit: 5d4f7b46edbe0d5332645af623fe3f8e2cf0f75c
Parents: cfcbeed
Author: pascalschumacher <pa...@gmx.net>
Authored: Mon Sep 21 19:47:37 2015 +0200
Committer: pascalschumacher <pa...@gmx.net>
Committed: Mon Sep 21 19:47:37 2015 +0200

----------------------------------------------------------------------
 src/spec/doc/core-differences-java.adoc | 4 ----
 src/spec/doc/core-semantics.adoc        | 2 --
 2 files changed, 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/5d4f7b46/src/spec/doc/core-differences-java.adoc
----------------------------------------------------------------------
diff --git a/src/spec/doc/core-differences-java.adoc b/src/spec/doc/core-differences-java.adoc
index 611fa22..cd60bfd 100644
--- a/src/spec/doc/core-differences-java.adoc
+++ b/src/spec/doc/core-differences-java.adoc
@@ -346,7 +346,3 @@ variable names etc.
 * `def`
 * `in`
 * `trait`
-
-== default must be last in switch case
-
-`default` must go at the end of the switch/case. While in Java the default can be placed anywhere in the switch/case, the `default` in Groovy is used more as an else than assigning a default case.

http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/5d4f7b46/src/spec/doc/core-semantics.adoc
----------------------------------------------------------------------
diff --git a/src/spec/doc/core-semantics.adoc b/src/spec/doc/core-semantics.adoc
index a05ca5d..9b3f23b 100644
--- a/src/spec/doc/core-semantics.adoc
+++ b/src/spec/doc/core-semantics.adoc
@@ -166,8 +166,6 @@ Switch supports the following kinds of comparisons:
 * Closure case values match if the calling the closure returns a result which is true according to the <<Groovy-Truth,Groovy truth>>
 * If none of the above are used then the case value matches if the case value equals the switch value
 
-NOTE: `default` must go at the end of the switch/case. While in Java the default can be placed anywhere in the switch/case, the default in Groovy is used more as an else than assigning a default case.
-
 NOTE: When using a closure case value, the default `it` parameter is actually the switch value (in our example, variable `x`).
 
 ==== Looping structures