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 2017/12/06 02:42:35 UTC
[4/5] groovy git commit: Make EmptyStatement singleton
Make EmptyStatement singleton
(cherry picked from commit dd8a7cb)
Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/cc071d25
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/cc071d25
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/cc071d25
Branch: refs/heads/GROOVY_2_6_X
Commit: cc071d2520d5971b3faf3e6a8209228251d8d1fd
Parents: 8a96837
Author: sunlan <su...@apache.org>
Authored: Wed Dec 6 09:41:12 2017 +0800
Committer: sunlan <su...@apache.org>
Committed: Wed Dec 6 10:40:37 2017 +0800
----------------------------------------------------------------------
.../org/codehaus/groovy/ast/stmt/EmptyStatement.java | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/groovy/blob/cc071d25/src/main/org/codehaus/groovy/ast/stmt/EmptyStatement.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/ast/stmt/EmptyStatement.java b/src/main/org/codehaus/groovy/ast/stmt/EmptyStatement.java
index 2e6b2da..2ef78af 100644
--- a/src/main/org/codehaus/groovy/ast/stmt/EmptyStatement.java
+++ b/src/main/org/codehaus/groovy/ast/stmt/EmptyStatement.java
@@ -29,15 +29,19 @@ import java.util.Map;
*
* @author <a href="mailto:james@coredevelopers.net">James Strachan</a>
*/
+
public class EmptyStatement extends Statement {
public static final EmptyStatement INSTANCE = new EmptyStatement();
/**
* use EmptyStatement.INSTANCE instead
*/
- @Deprecated
- public EmptyStatement() {}
-
+// @Deprecated
+ private EmptyStatement() {
+ // org.spockframework.compiler.ConditionRewriter will create EmptyStatement via calling the constructor
+ // so we keep the constructor for the time being, but it will be removed finally.
+ }
+
public void visit(GroovyCodeVisitor visitor) {
}
@@ -45,7 +49,6 @@ public class EmptyStatement extends Statement {
return true;
}
-
@Override
public void setStatementLabel(String label) {
throw createUnsupportedOperationException();