Quantcast

[01/50] [abbrv] groovy git commit: refactor(idea): set language level to 1.8

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
50 messages Options
12345
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[01/50] [abbrv] groovy git commit: refactor(idea): set language level to 1.8

paulk
Repository: groovy
Updated Branches:
  refs/heads/parrot 3caf3a458 -> 35f0fa07e


refactor(idea): set language level to 1.8


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

Branch: refs/heads/parrot
Commit: 7cfaa270730fa6de2a3d10f423a9efa53d3b0022
Parents: 4275767
Author: John Wagenleitner <[hidden email]>
Authored: Sat Apr 22 08:31:50 2017 -0700
Committer: paulk <[hidden email]>
Committed: Thu May 11 08:03:18 2017 +1000

----------------------------------------------------------------------
 gradle/idea.gradle | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/7cfaa270/gradle/idea.gradle
----------------------------------------------------------------------
diff --git a/gradle/idea.gradle b/gradle/idea.gradle
index 21af30f..f8fa6ea 100644
--- a/gradle/idea.gradle
+++ b/gradle/idea.gradle
@@ -48,7 +48,7 @@ idea {
 
                 // jdk, language level fix
                 def pRoot = node.component.find { it.'@name' == 'ProjectRootManager' }
-                pRoot.'@languageLevel' = 'JDK_1_7'
+                pRoot.'@languageLevel' = 'JDK_1_8'
                 pRoot.'@project-jdk-name' = '1.8'
 
                 // Use git

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[02/50] [abbrv] groovy git commit: GROOVY-8127: Access to Trait$Trait$Helper#$self is forbidden (closes #529)

paulk
GROOVY-8127: Access to Trait$Trait$Helper#$self is forbidden (closes #529)


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

Branch: refs/heads/parrot
Commit: aff9fff589e6d3eb8d9f405cf8dfdf258128b488
Parents: 7cfaa27
Author: paulk <[hidden email]>
Authored: Mon Apr 24 18:02:34 2017 +1000
Committer: paulk <[hidden email]>
Committed: Thu May 11 08:03:38 2017 +1000

----------------------------------------------------------------------
 .../transform/trait/TraitASTTransformation.java | 22 ++++----
 .../groovy/transform/trait/TraitComposer.java   |  7 +--
 src/test/groovy/bugs/Groovy8127Bug.groovy       | 53 ++++++++++++++++++++
 3 files changed, 70 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/aff9fff5/src/main/org/codehaus/groovy/transform/trait/TraitASTTransformation.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/transform/trait/TraitASTTransformation.java b/src/main/org/codehaus/groovy/transform/trait/TraitASTTransformation.java
index 8222056..4ac7753 100644
--- a/src/main/org/codehaus/groovy/transform/trait/TraitASTTransformation.java
+++ b/src/main/org/codehaus/groovy/transform/trait/TraitASTTransformation.java
@@ -73,9 +73,13 @@ import static org.codehaus.groovy.ast.tools.GeneralUtils.returnS;
 import static org.codehaus.groovy.transform.trait.SuperCallTraitTransformer.UNRESOLVED_HELPER_CLASS;
 
 /**
- * Handles generation of code for the @Trait annotation. A class annotated with @Trait will generate, instead: <ul>
- * <li>an <i>interface</i> with the same name</li> <li>an utility inner class that will be used by the compiler to
- * handle the trait</li> </ul>
+ * Handles generation of code for the traits (trait keyword is equivalent to using the @Trait annotation).
+ * A class annotated with @Trait will generate, instead:
+ * <ul>
+ * <li>an <i>interface</i> with the same name</li>
+ * <li>a utility inner class that will be used by the compiler to implement the trait</li>
+ * <li>potentially a utility inner class to assist with implementing trait fields</li>
+ * </ul>
  *
  * @author Cedric Champeau
  */
@@ -415,21 +419,21 @@ public class TraitASTTransformation extends AbstractASTTransformation implements
         Expression initialExpression = field.getInitialExpression();
         MethodNode selectedMethod = field.isStatic()?staticInitializer:initializer;
         if (initialExpression != null) {
+            VariableExpression thisObject = new VariableExpression(selectedMethod.getParameters()[0]);
+            ExpressionStatement initCode = new ExpressionStatement(initialExpression);
+            processBody(thisObject, initCode, trait, helper, fieldHelper, knownFields);
             if (field.isFinal()) {
                 String baseName = field.isStatic() ? Traits.STATIC_INIT_METHOD : Traits.INIT_METHOD;
                 MethodNode fieldInitializer = new MethodNode(
                         baseName + Traits.remappedFieldName(trait, field.getName()),
                         ACC_STATIC | ACC_PUBLIC | ACC_SYNTHETIC,
                         field.getOriginType(),
-                        Parameter.EMPTY_ARRAY,
+                        new Parameter[]{createSelfParameter(trait, field.isStatic())},
                         ClassNode.EMPTY_ARRAY,
-                        returnS(initialExpression)
+                        returnS(initCode.getExpression())
                 );
                 helper.addMethod(fieldInitializer);
             }
-            VariableExpression thisObject = new VariableExpression(selectedMethod.getParameters()[0]);
-            ExpressionStatement initCode = new ExpressionStatement(initialExpression);
-            processBody(thisObject, initCode, trait, helper, fieldHelper, knownFields);
             BlockStatement code = (BlockStatement) selectedMethod.getCode();
             MethodCallExpression mce;
             if (field.isStatic()) {
@@ -480,7 +484,7 @@ public class TraitASTTransformation extends AbstractASTTransformation implements
                 ACC_STATIC | ACC_PUBLIC | ACC_FINAL | ACC_SYNTHETIC,
                 field.getOriginType(),
                 fieldHelper,
-                field.isFinal() ? initialExpression : null
+                null
         );
         // copy annotations from field to dummy field
         List<AnnotationNode> copied = new LinkedList<AnnotationNode>();

http://git-wip-us.apache.org/repos/asf/groovy/blob/aff9fff5/src/main/org/codehaus/groovy/transform/trait/TraitComposer.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/transform/trait/TraitComposer.java b/src/main/org/codehaus/groovy/transform/trait/TraitComposer.java
index 1025e61..b97f480 100644
--- a/src/main/org/codehaus/groovy/transform/trait/TraitComposer.java
+++ b/src/main/org/codehaus/groovy/transform/trait/TraitComposer.java
@@ -71,6 +71,7 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 
+import static org.codehaus.groovy.ast.tools.GeneralUtils.args;
 import static org.codehaus.groovy.ast.tools.GeneralUtils.assignX;
 import static org.codehaus.groovy.ast.tools.GeneralUtils.callX;
 import static org.codehaus.groovy.ast.tools.GeneralUtils.returnS;
@@ -257,13 +258,13 @@ public abstract class TraitComposer {
                             List<AnnotationNode> copied = new LinkedList<AnnotationNode>();
                             List<AnnotationNode> notCopied = new LinkedList<AnnotationNode>();
                             GeneralUtils.copyAnnotatedNodeAnnotations(helperField, copied, notCopied);
-                            FieldNode fieldNode = cNode.addField(fieldName, fieldMods, returnType, (fieldMods & Opcodes.ACC_FINAL) == 0 ? null : helperField.getInitialExpression());
+                            FieldNode fieldNode = cNode.addField(fieldName, fieldMods, returnType, null);
                             fieldNode.addAnnotations(copied);
                             // getInitialExpression above will be null if not in same source unit
                             // so instead set within (static) initializer
-                            if (fieldNode.isFinal() && !(helperClassNode instanceof InnerClassNode)) {
+                            if (fieldNode.isFinal()) {
                                 String baseName = fieldNode.isStatic() ? Traits.STATIC_INIT_METHOD : Traits.INIT_METHOD;
-                                Expression mce = callX(helperClassNode, baseName + fieldNode.getName());
+                                Expression mce = callX(helperClassNode, baseName + fieldNode.getName(), args(varX("this")));
                                 Statement stmt = stmt(assignX(varX(fieldNode.getName(), fieldNode.getType()), mce));
                                 if (isStatic == 0) {
                                     cNode.addObjectInitializerStatements(stmt);

http://git-wip-us.apache.org/repos/asf/groovy/blob/aff9fff5/src/test/groovy/bugs/Groovy8127Bug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/Groovy8127Bug.groovy b/src/test/groovy/bugs/Groovy8127Bug.groovy
new file mode 100644
index 0000000..842390e
--- /dev/null
+++ b/src/test/groovy/bugs/Groovy8127Bug.groovy
@@ -0,0 +1,53 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package groovy.bugs
+
+import gls.CompilableTestSupport
+
+class Groovy8127Bug extends CompilableTestSupport {
+    void testTraitWithClosureReferencingField() {
+        assertScript """
+        trait BarTrait {
+            String result = ''
+            public final Runnable bar = { result = 'changeme' } as Runnable
+            void doRun() { bar.run() }
+        }
+
+        class Bar implements BarTrait {}
+
+        def b = new Bar()
+        b.doRun()
+        assert b.result == 'changeme'
+        """
+    }
+
+    void testTraitWithCompileStaticAndCoercedClosure() {
+        shouldCompile """
+        @groovy.transform.CompileStatic
+        trait FooTrait {
+            public final Runnable foo = { println new Date() } as Runnable
+            void doRun() { foo.run() }
+        }
+
+        class Foo implements FooTrait { }
+
+        new Foo().doRun()
+        """
+    }
+}

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[03/50] [abbrv] groovy git commit: GROOVY-7579: Improve docs for invokeMethod (closes #528)

paulk
In reply to this post by paulk
GROOVY-7579: Improve docs for invokeMethod (closes #528)


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

Branch: refs/heads/parrot
Commit: 8a17a1e27e0b4106d65ca0c5f0d511c51d0a58f7
Parents: aff9fff
Author: John Wagenleitner <[hidden email]>
Authored: Sun Apr 23 16:06:13 2017 -0700
Committer: paulk <[hidden email]>
Committed: Thu May 11 08:03:50 2017 +1000

----------------------------------------------------------------------
 src/spec/doc/core-metaprogramming.adoc | 43 +++++++++++++++++------------
 1 file changed, 25 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/8a17a1e2/src/spec/doc/core-metaprogramming.adoc
----------------------------------------------------------------------
diff --git a/src/spec/doc/core-metaprogramming.adoc b/src/spec/doc/core-metaprogramming.adoc
index 52344fd..4609d7f 100644
--- a/src/spec/doc/core-metaprogramming.adoc
+++ b/src/spec/doc/core-metaprogramming.adoc
@@ -21,19 +21,19 @@
 
 = Metaprogramming
 
-The Groovy language supports two flavors of metaprogramming: runtime metaprogramming and compile-time metaprogramming.
-The first one allows altering the class model and the behavior of a program at runtime, while the second only occurs
-at compile-time. Both have pros and cons, that we will detail in this section.
+The Groovy language supports two flavors of metaprogramming: runtime and compile-time.
+The first allows altering the class model and the behavior of a program at runtime while the second only occurs
+at compile-time. Both have pros and cons that we will detail in this section.
 
 == Runtime metaprogramming
-With runtime metaprogramming we can postpone to runtime the decision to intercept, inject and even synthesize methods of classes and interfaces. For a deep understanding of Groovy MOP we need to understand Groovy objects and Groovy's method handling.
-In Groovy we work with three kinds of objects: POJO, POGO and Groovy Interceptors. Groovy allows metaprogramming for all types of objects but in different manner.
+With runtime metaprogramming we can postpone to runtime the decision to intercept, inject and even synthesize methods of classes and interfaces. For a deep understanding of Groovy's metaobject protocol (MOP) we need to understand Groovy objects and Groovy's method handling.
+In Groovy we work with three kinds of objects: POJO, POGO and Groovy Interceptors. Groovy allows metaprogramming for all types of objects but in a different manner.
 
-- POJO - A regular Java object, whose class can be written in Java or any other language for the JVM.
-- POGO - A Groovy object, whose class is written in Groovy. It extends `java.lang.Object` and implements the gapi:groovy.lang.GroovyObject[] interface by default.
-- Groovy Interceptor - A Groovy object that implements the gapi:groovy.lang.GroovyInterceptable[] interface and has method-interception capability, which we'll discuss in the <<core-metaprogramming.adoc#_groovyinterceptable,GroovyInterceptable>> section.
+- POJO - A regular Java object whose class can be written in Java or any other language for the JVM.
+- POGO - A Groovy object whose class is written in Groovy. It extends `java.lang.Object` and implements the gapi:groovy.lang.GroovyObject[] interface by default.
+- Groovy Interceptor - A Groovy object that implements the gapi:groovy.lang.GroovyInterceptable[] interface and has method-interception capability which is discussed in the <<core-metaprogramming.adoc#_groovyinterceptable,GroovyInterceptable>> section.
 
-For every method call Groovy checks whether the object is a POJO or a POGO. For POJOs, Groovy fetches it's `MetaClass` from the gapi:groovy.lang.MetaClassRegistry[] and delegates method invocation to it. For POGOs, Groovy takes more steps, as illustrated in the following figure:
+For every method call Groovy checks whether the object is a POJO or a POGO. For POJOs, Groovy fetches its `MetaClass` from the gapi:groovy.lang.MetaClassRegistry[] and delegates method invocation to it. For POGOs, Groovy takes more steps, as illustrated in the following figure:
 
 .Groovy interception mechanism
 image::assets/img/GroovyInterceptions.png[align="center"]
@@ -62,14 +62,21 @@ public interface GroovyObject {
 
 ==== invokeMethod
 
-According to the schema in <<core-metaprogramming.adoc#_runtime_metaprogramming,Runtime Metaprogramming>> this method is called when the method you called is not present on a Groovy object.
-Here is a simple example using a overridden `invokeMethod()` method:
+This method is primarily intended to be used in conjunction with the <<core-metaprogramming.adoc#_groovyinterceptable,GroovyInterceptable>>
+interface or an object's `MetaClass` where it will intercept all method calls.
+
+It is also invoked when the method called is not present on a Groovy object. Here is a simple example using an
+overridden `invokeMethod()` method:
 
 [source,groovy]
 ----
 include::{projectdir}/src/spec/test/metaprogramming/GroovyObjectTest.groovy[tags=groovy_invoke_method,indent=0]
 ----
 
+However, the use of `invokeMethod` to intercept missing methods is discouraged.  In cases where the intent is to only
+intercept method calls in the case of a failed method dispatch use <<core-metaprogramming.adoc#_methodmissing,methodMissing>>
+instead.
+
 ==== get/setProperty
 
 Every read access to a property can be intercepted by overriding the `getProperty()` method of the current object.
@@ -90,7 +97,7 @@ include::{projectdir}/src/spec/test/metaprogramming/GroovyObjectTest.groovy[tags
 
 ==== get/setMetaClass
 
-You can a access an object's `metaClass` or set your own `MetaClass` implementation for changing the default interception mechanism. For example you can write your own implementation of the `MetaClass` interface and assign to it to objects and accordingly change the interception mechanism:
+You can a access an object's `metaClass` or set your own `MetaClass` implementation for changing the default interception mechanism. For example, you can write your own implementation of the `MetaClass` interface and assign it to objects in order to change the interception mechanism:
 
 [source,groovy]
 ----
@@ -106,7 +113,7 @@ You can find an additional example in the <<core-metaprogramming.adoc#_groovyint
 
 === get/setAttribute
 
-This functionality is related to the `MetaClass` implementation. In the default implementation you can access fields without invoking their getters and setters. The examples below demonstrate this approach:
+This functionality is related to the `MetaClass` implementation. In the default implementation you can access fields without invoking their getters and setters. The examples below demonstrates this approach:
 
 [source, groovy]
 ----
@@ -121,7 +128,7 @@ include::{projectdir}/src/spec/test/metaprogramming/GroovyObjectTest.groovy[tags
 === methodMissing
 
 Groovy supports the concept of `methodMissing`. This method differs from `invokeMethod` in that it
-is only invoked in case of a failed method dispatch, when no method can be found for the given name and/or the
+is only invoked in the case of a failed method dispatch when no method can be found for the given name and/or the
 given arguments:
 
 [source,groovy]
@@ -131,7 +138,7 @@ include::{projectdir}/src/spec/test/metaprogramming/MethodPropertyMissingTest.gr
 
 Typically when using `methodMissing` it is possible to cache the result for the next time the same method is called.
 
-For example consider dynamic finders in GORM. These are implemented in terms of `methodMissing`. The code resembles
+For example, consider dynamic finders in GORM. These are implemented in terms of `methodMissing`. The code resembles
 something like this:
 
 [source,groovy]
@@ -194,7 +201,7 @@ package groovy.lang;
 public interface GroovyInterceptable extends GroovyObject {
 }
 ----
-When a Groovy object implements the `GroovyInterceptable` interface, it's `invokeMethod()` is called for any method calls. Below you can see a simple example of a object of this type:
+When a Groovy object implements the `GroovyInterceptable` interface, its `invokeMethod()` is called for any method calls. Below you can see a simple example of a object of this type:
 
 [source,groovy]
 ----
@@ -209,9 +216,9 @@ include::{projectdir}/src/spec/test/metaprogramming/InterceptableTest.groovy[tag
 ----
 
 [NOTE]
-We cannot use default groovy methods like `println` because these methods are injected into all groovy objects so they will be intercepted too.
+We cannot use default groovy methods like `println` because these methods are injected into all Groovy objects so they will be intercepted too.
 
-If we want to intercept all methods call but do not want to implement the `GroovyInterceptable` interface we can implement `invokeMethod()` on an object's `MetaClass`.
+If we want to intercept all method calls but do not want to implement the `GroovyInterceptable` interface we can implement `invokeMethod()` on an object's `MetaClass`.
 This approach works for both POGOs and POJOs, as shown by this example:
 
 [source,groovy]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[04/50] [abbrv] groovy git commit: clean-up now that jdk7 is baseline (closes #526)

paulk
In reply to this post by paulk
clean-up now that jdk7 is baseline (closes #526)


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

Branch: refs/heads/parrot
Commit: 84df2e11fcbdcafe032910b3e1320f6be59377d1
Parents: 8a17a1e
Author: PascalSchumacher <[hidden email]>
Authored: Fri Apr 21 20:27:22 2017 +0200
Committer: paulk <[hidden email]>
Committed: Thu May 11 08:04:03 2017 +1000

----------------------------------------------------------------------
 .../groovy/control/CompilerConfiguration.java   | 10 +-----
 src/spec/doc/invokedynamic-support.adoc         |  7 ++---
 .../CircularLanguageReferenceTest.groovy        | 33 --------------------
 .../PropertyUsageFromJavaTest.groovy            | 33 --------------------
 .../src/main/java/groovy/json/internal/Sys.java |  8 +----
 5 files changed, 5 insertions(+), 86 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/84df2e11/src/main/org/codehaus/groovy/control/CompilerConfiguration.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/control/CompilerConfiguration.java b/src/main/org/codehaus/groovy/control/CompilerConfiguration.java
index a3107ac..1ee26d3 100644
--- a/src/main/org/codehaus/groovy/control/CompilerConfiguration.java
+++ b/src/main/org/codehaus/groovy/control/CompilerConfiguration.java
@@ -37,8 +37,6 @@ import java.util.*;
 
 public class CompilerConfiguration {
 
-    private static final String JDK5_CLASSNAME_CHECK = "java.lang.annotation.Annotation";
-
     /** This (<code>"indy"</code>) is the Optimization Option value for enabling <code>invokedynamic</code> complilation. */
     public static final String INVOKEDYNAMIC = "indy";
 
@@ -800,13 +798,7 @@ public class CompilerConfiguration {
     }
     
     private static String getVMVersion() {
-        try {
-            Class.forName(JDK5_CLASSNAME_CHECK);
-            return POST_JDK5;
-        } catch(Exception ex) {
-            // IGNORE
-        }
-        return PRE_JDK5;
+        return POST_JDK5;
     }
     
     /**

http://git-wip-us.apache.org/repos/asf/groovy/blob/84df2e11/src/spec/doc/invokedynamic-support.adoc
----------------------------------------------------------------------
diff --git a/src/spec/doc/invokedynamic-support.adoc b/src/spec/doc/invokedynamic-support.adoc
index 7c3314a..944d938 100644
--- a/src/spec/doc/invokedynamic-support.adoc
+++ b/src/spec/doc/invokedynamic-support.adoc
@@ -28,7 +28,6 @@ Since Groovy 2.0, we added support for the JVM http://docs.oracle.com/javase/7/d
 
 This means that unlike APIs, AST transformations or syntactic sugar, this feature is **not visible** to the developer or the end user. It is a compilation and runtime feature only. This means that given two programs written in Groovy, you have the choice to compile it with or without invokedynamic support. Whatever you choose, it comes with pros and cons:
 
-- classes compiled with invokedynamic can only be used on JDK 1.7+ (without invokedynamic, Groovy classes are still compatible with JDK 1.5+)
 - call site caching, as implemented in "normal" Groovy is replaced with invokedynamic since Groovy 2.1
 - it is possible to mix classes compiled with and without invokedynamic in the same project, as long as you run JDK 1.7+
 - depending on the JVM (even different minor versions of the JVM), you can target close to Java performance for dynamic Groovy with invokedynamic support activated
@@ -39,8 +38,8 @@ This means that unlike APIs, AST transformations or syntactic sugar, this featur
 
 The Groovy distribution comes with **two** jars:
 
-- groovy-x.y.z.jar : compatible with JDK 1.5+, makes use of call site caching
-- groovy-x-y-z-indy.jar : compatible with JDK 1.7+ only, has invokedynamic support bundled, old call site caching still possible
+- groovy-x.y.z.jar : makes use of call site caching
+- groovy-x-y-z-indy.jar : has invokedynamic support bundled, old call site caching still possible
 
 The first jar is Groovy compiled without invokedynamic support, while the second one has invokedynamic support bundled. As Groovy core and the groovy modules are sometimes written in Groovy, we currently have no choice but issuing two distinct versions of Groovy. This means that if you pick the "normal" jar, the groovy classes of groovy itself are compiled with call site caching (1.5+), while if you use the "indy" jar, the groovy classes of groovy itself are compiled using invokedynamic. This means that the invokedynamic version of Groovy doesn't make use of the old call site caching mechanism.
 
@@ -96,4 +95,4 @@ Independently of the jar version that you use (and after having exchanged the ja
 |invokedynamic
 |===
 
-So even if you use the indy jar, if you don't use the invokedynamic flag at compile time, then the compiled classes will use the "old" format, meaning they will use the JDK1.5+ classes without invokedynamic.
\ No newline at end of file
+So even if you use the indy jar, if you don't use the invokedynamic flag at compile time, then the compiled classes will use the "old" format.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/84df2e11/src/test/org/codehaus/groovy/tools/stubgenerator/CircularLanguageReferenceTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/tools/stubgenerator/CircularLanguageReferenceTest.groovy b/src/test/org/codehaus/groovy/tools/stubgenerator/CircularLanguageReferenceTest.groovy
index 1035cbd..4450bed 100644
--- a/src/test/org/codehaus/groovy/tools/stubgenerator/CircularLanguageReferenceTest.groovy
+++ b/src/test/org/codehaus/groovy/tools/stubgenerator/CircularLanguageReferenceTest.groovy
@@ -18,12 +18,6 @@
  */
 package org.codehaus.groovy.tools.stubgenerator
 
-import org.junit.After
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.JUnit4
-
 /**
  * Test circular reference between Java and Groovy, as well as inheritance:
  * a Shape Java interface is implemented by a Rectangle Groovy class,
@@ -33,30 +27,8 @@ import org.junit.runners.JUnit4
  *
  * @author Guillaume Laforge
  */
-import static org.junit.Assume.assumeFalse
-
-@RunWith(JUnit4)
 class CircularLanguageReferenceTest extends StubTestCase {
 
-    @Before
-    void setUp() {
-        assumeNotOnTravisCIAndNotJava6()
-        super.setUp()
-    }
-
-    private assumeNotOnTravisCIAndNotJava6() {
-        boolean travisCI = new File('.').absolutePath =~ /travis/
-        boolean java6 = System.getProperty('java.version').startsWith('1.6')
-
-        assumeFalse('''Test always fails with "java.lang.IllegalArgumentException: URI is not hierarchical"
-            on open jdk used by travis.''', travisCI && java6)
-    }
-
-    @Test
-    void test() {
-        super.testRun()
-    }
-
     void verifyStubs() {
         classes['stubgenerator.circularLanguageReference.Rectangle'].with {
             assert methods['area'     ].signature == "public double area()"
@@ -67,10 +39,5 @@ class CircularLanguageReferenceTest extends StubTestCase {
             assert imports == ['java.lang.*', 'java.io.*', 'java.net.*', 'java.util.*', 'groovy.lang.*', 'groovy.util.*']
         }
     }
-
-    @After
-    void tearDown() {
-        super.tearDown()
-    }
 }
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/84df2e11/src/test/org/codehaus/groovy/tools/stubgenerator/PropertyUsageFromJavaTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/tools/stubgenerator/PropertyUsageFromJavaTest.groovy b/src/test/org/codehaus/groovy/tools/stubgenerator/PropertyUsageFromJavaTest.groovy
index e199972..eb34176 100644
--- a/src/test/org/codehaus/groovy/tools/stubgenerator/PropertyUsageFromJavaTest.groovy
+++ b/src/test/org/codehaus/groovy/tools/stubgenerator/PropertyUsageFromJavaTest.groovy
@@ -18,41 +18,13 @@
  */
 package org.codehaus.groovy.tools.stubgenerator
 
-import org.junit.After
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.JUnit4
-
-import static org.junit.Assume.assumeFalse
-
 /**
  * Tests Groovy properties and how they can be used from Java.
  *
  * @author Guillaume Laforge
  */
-@RunWith(JUnit4)
 class PropertyUsageFromJavaTest extends StubTestCase {
 
-    @Before
-    void setUp() {
-        assumeNotOnTravisCIAndNotJava6()
-        super.setUp()
-    }
-
-    private assumeNotOnTravisCIAndNotJava6() {
-        boolean travisCI = new File('.').absolutePath =~ /travis/
-        boolean java6 = System.getProperty('java.version').startsWith('1.6')
-
-        assumeFalse('''Test always fails with "java.lang.IllegalArgumentException: URI is not hierarchical"
-            on open jdk used by travis.''', travisCI && java6)
-    }
-
-    @Test
-    void test() {
-        super.testRun()
-    }
-
     void verifyStubs() {
         classes['stubgenerator.propertyUsageFromJava.somepackage.GroovyPogo'].with {
             assert methods['getAge'].signature == "public int getAge()"
@@ -61,10 +33,5 @@ class PropertyUsageFromJavaTest extends StubTestCase {
             assert methods['setName'].signature == "public void setName(java.lang.String value)"
         }
     }
-
-    @After
-    void tearDown() {
-        super.tearDown()
-    }
 }
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/84df2e11/subprojects/groovy-json/src/main/java/groovy/json/internal/Sys.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-json/src/main/java/groovy/json/internal/Sys.java b/subprojects/groovy-json/src/main/java/groovy/json/internal/Sys.java
index 8c2953c..4d8c3ed 100644
--- a/subprojects/groovy-json/src/main/java/groovy/json/internal/Sys.java
+++ b/subprojects/groovy-json/src/main/java/groovy/json/internal/Sys.java
@@ -24,7 +24,6 @@ import java.util.regex.Pattern;
 
 class Sys {
 
-    private static final boolean is1_7OrLater;
     private static final boolean is1_8OrLater;
     private static final boolean is1_7;
     private static final boolean is1_8;
@@ -37,10 +36,6 @@ class Sys {
             try {
                 String ver = split[0];
 
-                if (ver.startsWith("1.6")) {
-                    v = new BigDecimal("1.6");
-                }
-
                 if (ver.startsWith("1.7")) {
                     v = new BigDecimal("1.7");
                 }
@@ -66,14 +61,13 @@ class Sys {
             }
         }
 
-        is1_7OrLater = v.compareTo(new BigDecimal("1.7")) >= 0;
         is1_8OrLater = v.compareTo(new BigDecimal("1.8")) >= 0;
         is1_7 = v.compareTo(new BigDecimal("1.7")) == 0;
         is1_8 = v.compareTo(new BigDecimal("1.8")) == 0;
     }
 
     public static boolean is1_7OrLater() {
-        return is1_7OrLater;
+        return true;
     }
 
     public static boolean is1_8OrLater() {

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[05/50] [abbrv] groovy git commit: remove skipping of tests for builds.apache.org as we no longer use it (closes #527)

paulk
In reply to this post by paulk
remove skipping of tests for builds.apache.org as we no longer use it (closes #527)


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

Branch: refs/heads/parrot
Commit: adad2a0fa73ab494fe7bcc93e521609278b9bf69
Parents: 84df2e1
Author: PascalSchumacher <[hidden email]>
Authored: Sun Apr 23 11:04:00 2017 +0200
Committer: paulk <[hidden email]>
Committed: Thu May 11 08:04:15 2017 +1000

----------------------------------------------------------------------
 src/test/groovy/grape/GrapeIvyTest.groovy       | 35 +--------
 src/test/groovy/lang/ClassReloadingTest.groovy  | 17 -----
 .../groovy/groovy/swing/SwingBuilderTest.groovy | 79 --------------------
 3 files changed, 1 insertion(+), 130 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/adad2a0f/src/test/groovy/grape/GrapeIvyTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/grape/GrapeIvyTest.groovy b/src/test/groovy/grape/GrapeIvyTest.groovy
index bd33870..1bc845f 100644
--- a/src/test/groovy/grape/GrapeIvyTest.groovy
+++ b/src/test/groovy/grape/GrapeIvyTest.groovy
@@ -20,17 +20,11 @@ package groovy.grape
 
 import org.codehaus.groovy.control.CompilationFailedException
 import gls.CompilableTestSupport
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.JUnit4
-
-import static org.junit.Assume.assumeFalse
 
 /**
  * @author Danno Ferrin
  * @author Paul King
  */
-@RunWith(JUnit4)
 class GrapeIvyTest extends CompilableTestSupport {
 
     GrapeIvyTest() {
@@ -45,7 +39,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         }
     }
 
-    @Test
     void testSingleArtifact() {
         GroovyClassLoader loader = new GroovyClassLoader()
         GroovyShell shell = new GroovyShell(loader)
@@ -56,7 +49,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         assert shell.evaluate("import com.jidesoft.swing.JideSplitButton; JideSplitButton.class").name == 'com.jidesoft.swing.JideSplitButton';
     }
 
-    @Test
     void testModuleWithDependencies() {
         GroovyClassLoader loader = new GroovyClassLoader()
         GroovyShell shell = new GroovyShell(loader)
@@ -67,7 +59,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         assert shell.evaluate("import org.apache.poi.POIDocument; POIDocument.class").name == 'org.apache.poi.POIDocument'
     }
 
-    @Test
     void testMultipleDependencies() {
         GroovyClassLoader loader = new GroovyClassLoader()
         GroovyShell shell = new GroovyShell(loader)
@@ -86,7 +77,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         assert shell.evaluate("import org.apache.poi.POIDocument; POIDocument.class").name == 'org.apache.poi.POIDocument'
     }
 
-    @Test
     void testListDependencies() {
         GroovyClassLoader loader = new GroovyClassLoader()
         GroovyShell shell = new GroovyShell(loader)
@@ -108,7 +98,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         ]
     }
 
-    @Test
     void testGrabRefless() {
         GroovyClassLoader loader = new GroovyClassLoader()
         GroovyShell shell = new GroovyShell(loader)
@@ -119,7 +108,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         assert shell.evaluate("import com.jidesoft.swing.JideSplitButton; JideSplitButton.class").name == 'com.jidesoft.swing.JideSplitButton';
     }
 
-    @Test
     void testGrabScriptClass() {
         GroovyClassLoader loader = new GroovyClassLoader()
         GroovyShell shell = new GroovyShell(loader)
@@ -130,7 +118,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         assert shell.evaluate("import com.jidesoft.swing.JideSplitButton; JideSplitButton.class").name == 'com.jidesoft.swing.JideSplitButton';
     }
 
-    @Test
     void testGrabScriptLoader() {
         GroovyClassLoader loader = new GroovyClassLoader()
         GroovyShell shell = new GroovyShell(loader)
@@ -142,7 +129,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         assert shell.evaluate("import com.jidesoft.swing.JideSplitButton; JideSplitButton.class").name == 'com.jidesoft.swing.JideSplitButton';
     }
 
-    @Test
     void testGrabReflessMultiple() {
         GroovyClassLoader loader = new GroovyClassLoader()
         GroovyShell shell = new GroovyShell(loader)
@@ -160,7 +146,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         assert shell.evaluate("import org.apache.poi.POIDocument; POIDocument.class").name == 'org.apache.poi.POIDocument'
     }
 
-    @Test
     void testGrabScriptClassMultiple() {
         GroovyClassLoader loader = new GroovyClassLoader()
         GroovyShell shell = new GroovyShell(loader)
@@ -178,7 +163,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         assert shell.evaluate("import org.apache.poi.POIDocument; POIDocument.class").name == 'org.apache.poi.POIDocument'
     }
 
-    @Test
     void testGrabScriptLoaderMultiple() {
         GroovyClassLoader loader = new GroovyClassLoader()
         GroovyShell shell = new GroovyShell(loader)
@@ -197,7 +181,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         assert shell.evaluate("import org.apache.poi.POIDocument; POIDocument.class").name == 'org.apache.poi.POIDocument'
     }
 
-    @Test
     void testSerialGrabs() {
         GroovyClassLoader loader = new GroovyClassLoader()
         Grape.grab(groupId:'log4j', artifactId:'log4j', version:'1.1.3', classLoader:loader)
@@ -215,7 +198,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         assert !jars.contains ("log4j-1.2.13.jar")
     }
 
-    @Test
     void testConf() {
         GroovyClassLoader loader = new GroovyClassLoader()
 
@@ -265,7 +247,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         loader.getURLs().collect { URL it -> it.getPath().split('/')[-1] } as Set
     }
 
-    @Test
     void testClassifier() {
         GroovyClassLoader loader = new GroovyClassLoader()
         GroovyShell shell = new GroovyShell(loader)
@@ -276,10 +257,7 @@ class GrapeIvyTest extends CompilableTestSupport {
         assert shell.evaluate("import net.sf.json.JSON; JSON").name == 'net.sf.json.JSON'
     }
 
-    @Test
     void testClassifierWithConf() {
-        assumeNotOnBuildsApacheOrgAndNotOnWindows()
-
         def coreJars = [
                 "json-lib-2.2.3-jdk15.jar",
                 "commons-lang-2.4.jar",
@@ -320,13 +298,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         assert jarNames(loader) == coreJars + optionalJars
     }
 
-    private assumeNotOnBuildsApacheOrgAndNotOnWindows() {
-        boolean buildsApacheOrg = new File('.').absolutePath =~ /jenkins|hudson/
-        boolean windows = System.properties['os.name'].toLowerCase().contains('windows')
-        assumeFalse('Test always fails on builds.apache.org on Windows, so we skip it there.', buildsApacheOrg && windows)
-    }
-
-    @Test
     void testTransitiveShorthandControl() {
         // BeanUtils is a transitive dependency for Digester
         assertScript '''
@@ -338,7 +309,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         '''
     }
 
-    @Test
     void testTransitiveShorthandExpectFailure() {
         assertScript '''
             @Grab('commons-digester:commons-digester:2.1;transitive=false')
@@ -352,7 +322,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         '''
     }
 
-    @Test
     void testAutoDownloadGrapeConfig() {
 
         assertScript '''
@@ -388,7 +357,6 @@ class GrapeIvyTest extends CompilableTestSupport {
     /**
      * GROOVY-470: multiple jars should be loaded for an artifacts with and without a classifier
      */
-    @Test
     void testClassifierAndNonClassifierOnSameArtifact() {
         GroovyClassLoader loader = new GroovyClassLoader()
         Grape.grab(groupId:'org.neo4j', artifactId:'neo4j-kernel', version:'2.0.0-RC1', classLoader:loader)
@@ -408,7 +376,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         assert jars.contains ("neo4j-kernel-2.0.0-RC1-tests.jar")
     }
 
-    @Test
     void testSystemProperties_groovy7548() {
         System.setProperty('groovy7548prop', 'x')
         assert System.getProperty('groovy7548prop') == 'x'
@@ -421,7 +388,7 @@ class GrapeIvyTest extends CompilableTestSupport {
         assert System.getProperty('groovy7548prop') == 'y'
     }
 
-    @Test // GROOVY-7649
+    // GROOVY-7649
     void testResolveSucceedsAfterFailure() {
         GroovyClassLoader loader = new GroovyClassLoader()
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/adad2a0f/src/test/groovy/lang/ClassReloadingTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/lang/ClassReloadingTest.groovy b/src/test/groovy/lang/ClassReloadingTest.groovy
index 197d637..e6b4ccd 100644
--- a/src/test/groovy/lang/ClassReloadingTest.groovy
+++ b/src/test/groovy/lang/ClassReloadingTest.groovy
@@ -18,21 +18,11 @@
  */
 package groovy.lang
 
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.JUnit4
-
-import static org.junit.Assume.assumeFalse
-
 import org.codehaus.groovy.control.CompilerConfiguration
 
-@RunWith(JUnit4)
 class ClassReloadingTest extends GroovyTestCase {
 
-    @Test
     void testReloading() {
-        assumeNotOnBuildsApacheOrg()
-
         def file = File.createTempFile("TestReload", ".groovy", new File("target"))
         file.deleteOnExit()
         def className = file.name - ".groovy"
@@ -73,12 +63,6 @@ class ClassReloadingTest extends GroovyTestCase {
         }
     }
 
-    private assumeNotOnBuildsApacheOrg() {
-        boolean buildsApacheOrg = new File('.').absolutePath =~ /jenkins|hudson/
-        assumeFalse('Test always fails on builds.apache.org, so we skip it there.', buildsApacheOrg)
-    }
-
-    @Test
     void testReloadingInStringStringVersion() {
         def fileName = "Dummy3981.groovy"
 
@@ -105,7 +89,6 @@ class ClassReloadingTest extends GroovyTestCase {
         assert "goodbye" == message
     }
 
-    @Test
     void testReloadingIfInitialFileMissesTimestamp() {
         def parent = File.createTempDir("reload","test")
         def file = File.createTempFile("TestReload", ".groovy", parent)

http://git-wip-us.apache.org/repos/asf/groovy/blob/adad2a0f/subprojects/groovy-swing/src/test/groovy/groovy/swing/SwingBuilderTest.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-swing/src/test/groovy/groovy/swing/SwingBuilderTest.groovy b/subprojects/groovy-swing/src/test/groovy/groovy/swing/SwingBuilderTest.groovy
index 7a609d6..9e6e1b1 100644
--- a/subprojects/groovy-swing/src/test/groovy/groovy/swing/SwingBuilderTest.groovy
+++ b/subprojects/groovy-swing/src/test/groovy/groovy/swing/SwingBuilderTest.groovy
@@ -18,10 +18,6 @@
  */
 package groovy.swing
 
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.JUnit4
-
 import javax.swing.JPopupMenu.Separator as JPopupMenu_Separator
 import javax.swing.JToolBar.Separator as JToolBar_Separator
 
@@ -36,21 +32,8 @@ import javax.swing.text.NumberFormatter
 import java.awt.*
 import javax.swing.*
 
-import static org.junit.Assume.assumeFalse
-
-@RunWith(JUnit4)
 class SwingBuilderTest extends GroovySwingTestCase {
 
-    private static final boolean buildsApacheOrg = new File('.').absolutePath =~ /jenkins|hudson/
-    private static final boolean windows = System.properties['os.name'].toLowerCase().contains('windows')
-
-    private assumeNotOnBuildsApacheOrgAndNotOnWindows() {
-        assumeFalse('''Filechooser seems bugy on Windows e.g.: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6973685
-on builds.apache.org these test fail with: java.lang.NullPointerException: at sun.awt.shell.Win32ShellFolder2.access$200(Win32ShellFolder2.java:72)
-Therefore we ship them on there.''', buildsApacheOrg && windows)
-    }
-
-    @Test
     void testWidgetId() {
         testInEDT {
 
@@ -75,10 +58,7 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testNamedWidgetCreation() {
-        assumeNotOnBuildsApacheOrgAndNotOnWindows()
-
         testInEDT {
             def topLevelWidgets = [
                     frame: [JFrame, true],
@@ -100,7 +80,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testLayoutCreation() {
         testInEDT {
 
@@ -122,7 +101,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testGridBagFactory() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -145,7 +123,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testBorderLayout() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -164,7 +141,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testLayoutConstraintsProperty() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -176,7 +152,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testWidgetCreation() {
         testInEDT {
 
@@ -228,7 +203,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testButtonGroup() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -262,7 +236,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testButtonGroupOnlyForButtons() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -274,7 +247,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testWidget() {
         testInEDT {
 
@@ -287,7 +259,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testSplitPane() {
         testInEDT {
 
@@ -310,7 +281,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testNestedWindows() {
         testInEDT {
 
@@ -341,7 +311,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testFrames() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -354,7 +323,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testDialogs() {
         testInEDT {
 
@@ -376,7 +344,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testWindows() {
         testInEDT {
 
@@ -387,7 +354,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testNodeCreation() {
         testInEDT {
 
@@ -408,7 +374,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testSetMnemonic() {
         testInEDT {
 
@@ -434,7 +399,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testBuilderProperties() {
         testInEDT {
 
@@ -443,7 +407,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testFormattedTextField() {
         testInEDT {
 
@@ -461,7 +424,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testScrollPane() {
         testInEDT {
 
@@ -475,7 +437,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testComboBox() {
         testInEDT {
 
@@ -490,7 +451,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testList() {
         testInEDT {
 
@@ -516,7 +476,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testMisplacedActionsAreIgnored() {
         testInEDT {
 
@@ -535,7 +494,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testBoxLayout() {
         testInEDT {
 
@@ -555,7 +513,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testKeystrokesWithinActions() {
         testInEDT {
 
@@ -584,7 +541,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testActionClosures() {
         testInEDT {
 
@@ -625,7 +581,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testSetAccelerator() {
         testInEDT {
 
@@ -648,7 +603,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         return action
     }
 
-    @Test
     void testSetAcceleratorShortcuts() {
         testInEDT {
 
@@ -665,7 +619,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testBorderLayoutConstraints() {
         testInEDT {
 
@@ -697,7 +650,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testSetConstraints() {
         testInEDT {
 
@@ -708,7 +660,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testSetToolTipText() {
         testInEDT {
 
@@ -720,7 +671,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testAttributeOrdering() {
         testInEDT {
 
@@ -745,7 +695,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testWidgetPassthroughConstraints() {
         testInEDT {
 
@@ -759,7 +708,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testGROOVY1837ReuseAction() {
         testInEDT {
 
@@ -775,7 +723,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testSeparators() {
         testInEDT {
 
@@ -795,7 +742,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testCollectionNodes() {
         testInEDT {
 
@@ -807,7 +753,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testFactoryCornerCases() {
         testInEDT {
 
@@ -824,7 +769,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testFactoryLogging() {
         testInEDT {
 
@@ -837,10 +781,7 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testEnhancedValueArguments() {
-        assumeNotOnBuildsApacheOrgAndNotOnWindows()
-
         testInEDT {
 
             def swing = new SwingBuilder()
@@ -1042,7 +983,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         instancePass = true
     }
 
-    @Test
     void testEDT() {
         if (HeadlessTestSupport.headless) return
         def swing = new SwingBuilder()
@@ -1060,7 +1000,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         assert instancePass
     }
 
-    @Test
     void testDoLater() {
         if (HeadlessTestSupport.headless) return
         def swing = new SwingBuilder()
@@ -1102,7 +1041,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         assert instancePass
     }
 
-    @Test
     void testDoOutside() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -1146,7 +1084,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testJumbledThreading() {
         if (HeadlessTestSupport.headless) return;
 
@@ -1228,7 +1165,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         assert swing != oldSwing
     }
 
-    @Test
     void testParallelBuild() {
         if (HeadlessTestSupport.headless) return;
 
@@ -1253,7 +1189,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         assert l.parent == null
     }
 
-    @Test
     void testDispose() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -1276,7 +1211,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testPackAndShow() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -1310,10 +1244,7 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testContainment() {
-        assumeNotOnBuildsApacheOrgAndNotOnWindows()
-
         testInEDT {
             def swing = new SwingBuilder()
 
@@ -1414,7 +1345,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testMenus() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -1460,7 +1390,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testLookAndFeel() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -1513,7 +1442,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testMultiLookAndFeel() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -1540,7 +1468,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testBorders() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -1634,7 +1561,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testBorderAttachment() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -1661,7 +1587,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testRenderer() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -1696,7 +1621,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testNoParent() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -1712,7 +1636,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testClientProperties() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -1728,7 +1651,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testKeyStrokeAction() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -1781,7 +1703,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testAutomaticNameBasedOnIdAttribute() {
         testInEDT {
             def swing = new SwingBuilder()

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[06/50] [abbrv] groovy git commit: fix spec test (closes #531)

paulk
In reply to this post by paulk
fix spec test (closes #531)


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

Branch: refs/heads/parrot
Commit: 2093378cdbfc34308386b345b9773818e17b00b6
Parents: a51162f
Author: John Wagenleitner <[hidden email]>
Authored: Sun Apr 30 13:14:24 2017 -0700
Committer: paulk <[hidden email]>
Committed: Thu May 11 08:04:48 2017 +1000

----------------------------------------------------------------------
 src/spec/test/SyntaxTest.groovy | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/2093378c/src/spec/test/SyntaxTest.groovy
----------------------------------------------------------------------
diff --git a/src/spec/test/SyntaxTest.groovy b/src/spec/test/SyntaxTest.groovy
index 40bfc15..96c3c47 100644
--- a/src/spec/test/SyntaxTest.groovy
+++ b/src/spec/test/SyntaxTest.groovy
@@ -501,8 +501,9 @@ class SyntaxTest extends CompilableTestSupport {
             $$ escaped dollar sign
             \ backslash
             / forward slash
-            $$/ escaped dollar forward slash
-            $/$ escaped closing dollar slashy
+            $/ escaped forward slash
+            $$$/ escaped opening dollar slashy
+            $/$$ escaped closing dollar slashy
         /$
 
         assert [
@@ -512,7 +513,8 @@ class SyntaxTest extends CompilableTestSupport {
             '$ escaped dollar sign',
             '\\ backslash',
             '/ forward slash',
-            '$/ escaped dollar forward slash',
+            '/ escaped forward slash',
+            '$/ escaped opening dollar slashy',
             '/$ escaped closing dollar slashy'
         ].every { dollarSlashy.contains(it) }
         // end::dollar_slashy_1[]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[07/50] [abbrv] groovy git commit: fixes groovy/groovy-website#100

paulk
In reply to this post by paulk
fixes groovy/groovy-website#100


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

Branch: refs/heads/parrot
Commit: a51162f9c2ddd428aabc5eb729e5ef5a99751142
Parents: cbd7413
Author: John Wagenleitner <[hidden email]>
Authored: Sun Apr 30 10:30:46 2017 -0700
Committer: paulk <[hidden email]>
Committed: Thu May 11 08:04:48 2017 +1000

----------------------------------------------------------------------
 src/spec/doc/core-syntax.adoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/a51162f9/src/spec/doc/core-syntax.adoc
----------------------------------------------------------------------
diff --git a/src/spec/doc/core-syntax.adoc b/src/spec/doc/core-syntax.adoc
index a0815d0..6d3bf45 100644
--- a/src/spec/doc/core-syntax.adoc
+++ b/src/spec/doc/core-syntax.adoc
@@ -947,7 +947,7 @@ include::{projectdir}/src/spec/test/SyntaxTest.groovy[tags=variable_store_boolea
 `true` and `false` are the only two primitive boolean values.
 But more complex boolean expressions can be represented using <<_bitwise_and_logical_operators,logical operators>>.
 
-In addition, Groovy has <<_the_groovy_truth,special rules>> (often referred to as _Groovy Truth_)
+In addition, Groovy has <<core-semantics.adoc#Groovy-Truth,special rules>> (often referred to as _Groovy Truth_)
 for coercing non-boolean objects to a boolean value.
 
 == Lists

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[08/50] [abbrv] groovy git commit: fixes groovy/groovy-website#99

paulk
In reply to this post by paulk
fixes groovy/groovy-website#99


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

Branch: refs/heads/parrot
Commit: cbd74135336c754885e695998c54f286f322ac5a
Parents: adad2a0
Author: John Wagenleitner <[hidden email]>
Authored: Sun Apr 30 10:19:44 2017 -0700
Committer: paulk <[hidden email]>
Committed: Thu May 11 08:04:48 2017 +1000

----------------------------------------------------------------------
 src/spec/test/SyntaxTest.groovy | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/cbd74135/src/spec/test/SyntaxTest.groovy
----------------------------------------------------------------------
diff --git a/src/spec/test/SyntaxTest.groovy b/src/spec/test/SyntaxTest.groovy
index e68f018..40bfc15 100644
--- a/src/spec/test/SyntaxTest.groovy
+++ b/src/spec/test/SyntaxTest.groovy
@@ -501,8 +501,8 @@ class SyntaxTest extends CompilableTestSupport {
             $$ escaped dollar sign
             \ backslash
             / forward slash
-            $/ escaped forward slash
-            $/$ escaped dollar slashy string delimiter
+            $$/ escaped dollar forward slash
+            $/$ escaped closing dollar slashy
         /$
 
         assert [
@@ -512,10 +512,9 @@ class SyntaxTest extends CompilableTestSupport {
             '$ escaped dollar sign',
             '\\ backslash',
             '/ forward slash',
-                '$/ escaped forward slash',
-                '/$ escaped dollar slashy string delimiter'
-
-                ].each { dollarSlashy.contains(it) }
+            '$/ escaped dollar forward slash',
+            '/$ escaped closing dollar slashy'
+        ].every { dollarSlashy.contains(it) }
         // end::dollar_slashy_1[]
     }
 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[09/50] [abbrv] groovy git commit: GROOVY-8174: Groovy.Sql+Oracle parameter substitution problem (closes #534)

paulk
In reply to this post by paulk
GROOVY-8174: Groovy.Sql+Oracle parameter substitution problem (closes #534)


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

Branch: refs/heads/parrot
Commit: 921f96d0477308350c81690213d3ab5ec35fbfe9
Parents: 2093378
Author: paulk <[hidden email]>
Authored: Thu May 4 10:53:41 2017 +1000
Committer: paulk <[hidden email]>
Committed: Thu May 11 08:05:34 2017 +1000

----------------------------------------------------------------------
 subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/921f96d0/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java b/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java
index 26d52df..fd0ff13 100644
--- a/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java
+++ b/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java
@@ -4114,8 +4114,10 @@ public class Sql {
                 Map paramsMap = (Map) params.get(0);
                 if (paramsMap.isEmpty()) return;
             }
-            if (metaData.getParameterCount() != params.size()) {
+            if (metaData.getParameterCount() < params.size()) {
                 throw new IllegalArgumentException("Found " + metaData.getParameterCount() + " parameter placeholders but supplied with " + params.size() + " parameters");
+            } else if (metaData.getParameterCount() != params.size()) {
+                LOG.warning("Found " + metaData.getParameterCount() + " parameter placeholders but supplied with " + params.size() + " parameters");
             }
         }
         for (Object value : params) {

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[10/50] [abbrv] groovy git commit: GROOVY-8161: Empty statement before semicolon with parrot parser

paulk
In reply to this post by paulk
GROOVY-8161: Empty statement before semicolon with parrot parser


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

Branch: refs/heads/parrot
Commit: 07456a51e98affe92ac626944e7ce3e6a45fe3b0
Parents: 53b4f90
Author: sunlan <[hidden email]>
Authored: Sat May 6 01:00:36 2017 +0800
Committer: paulk <[hidden email]>
Committed: Thu May 11 08:06:12 2017 +1000

----------------------------------------------------------------------
 .../apache/groovy/parser/antlr4/AstBuilder.java |  14 +-
 .../parser/antlr4/GroovyParserTest.groovy       | 312 ++++++++++---------
 .../test/resources/bugs/BUG-GROOVY-8161.groovy  |   2 +
 3 files changed, 172 insertions(+), 156 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/07456a51/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
index 087c291..e0708f7 100644
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
+++ b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
@@ -1285,14 +1285,14 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov
 
         this.configureAST(methodNode, ctx);
 
-        validateMethodDeclaration(ctx, methodNode, modifierManager);
+        validateMethodDeclaration(ctx, methodNode, modifierManager, classNode);
 
         groovydocManager.handle(methodNode, ctx);
 
         return methodNode;
     }
 
-    private void validateMethodDeclaration(MethodDeclarationContext ctx, MethodNode methodNode, ModifierManager modifierManager) {
+    private void validateMethodDeclaration(MethodDeclarationContext ctx, MethodNode methodNode, ModifierManager modifierManager, ClassNode classNode) {
         boolean isAbstractMethod = methodNode.isAbstract();
         boolean hasMethodBody = asBoolean(methodNode.getCode());
 
@@ -1304,6 +1304,11 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov
             if (!isAbstractMethod && !hasMethodBody) { // non-abstract method without body in the non-script(e.g. class, enum, trait) is not allowed!
                 throw createParsingFailedException("You defined a method[" + methodNode.getName() + "] without body. Try adding a method body, or declare it abstract", methodNode);
             }
+
+            boolean isInterfaceOrAbstractClass = asBoolean(classNode) && classNode.isAbstract() && !classNode.isAnnotationDefinition();
+            if (isInterfaceOrAbstractClass && !modifierManager.contains(DEFAULT) && isAbstractMethod && hasMethodBody) {
+                throw createParsingFailedException("You defined an abstract method[" + methodNode.getName() + "] with body. Try removing the method body" + (classNode.isInterface() ? ", or declare it default" : ""), methodNode);
+            }
         }
 
         modifierManager.validate(methodNode);
@@ -3470,11 +3475,12 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov
         return this.configureAST(
                 this.createBlockStatement(
                         ctx.blockStatement().stream()
-                                .map(this::visitBlockStatement).collect(Collectors.toList())),
+                                .map(this::visitBlockStatement)
+                                .filter(e -> asBoolean(e))
+                                .collect(Collectors.toList())),
                 ctx);
     }
 
-
     @Override
     public Statement visitBlockStatement(BlockStatementContext ctx) {
         if (asBoolean(ctx.localVariableDeclaration())) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/07456a51/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy b/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
index 6892237..480d2ab 100644
--- a/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
@@ -18,11 +18,18 @@
  */
 package org.apache.groovy.parser.antlr4
 
-import org.codehaus.groovy.ast.*
+import org.codehaus.groovy.ast.ClassNode
+import org.codehaus.groovy.ast.FieldNode
+import org.codehaus.groovy.ast.MethodNode
+import org.codehaus.groovy.ast.Parameter
+import org.codehaus.groovy.ast.PropertyNode
 import org.codehaus.groovy.ast.stmt.AssertStatement
 import org.codehaus.groovy.ast.stmt.ExpressionStatement
 import org.codehaus.groovy.syntax.Token
 
+import static org.apache.groovy.parser.antlr4.TestUtils.doTest
+import static org.apache.groovy.parser.antlr4.TestUtils.doRunAndTest
+
 /**
  * Some basic test cases for the new parser
  *
@@ -36,12 +43,12 @@ class GroovyParserTest extends GroovyTestCase {
     void tearDown() {}
 
     void "test groovy core - Comments"() {
-        TestUtils.doTest('core/Comments_01.groovy', [ExpressionStatement]);
+        doTest('core/Comments_01.groovy', [ExpressionStatement]);
         doTestAttachedComments();
     }
 
     private static doTestAttachedComments() {
-        def (newAST, oldAST) = TestUtils.doTest('core/Comments_02.groovy');
+        def (newAST, oldAST) = doTest('core/Comments_02.groovy');
         List<ClassNode> classes = new ArrayList<>(newAST.classes).sort { c1, c2 -> c1.name <=> c2.name };
         List<MethodNode> methods = new ArrayList<>(newAST.methods).sort { m1, m2 -> m1.name <=> m2.name };
 
@@ -76,285 +83,286 @@ class GroovyParserTest extends GroovyTestCase {
     }
 
     void "test groovy core - PackageDeclaration"() {
-        TestUtils.doTest('core/PackageDeclaration_01.groovy');
-        TestUtils.doTest('core/PackageDeclaration_02.groovy');
-        TestUtils.doTest('core/PackageDeclaration_03.groovy');
-        TestUtils.doTest('core/PackageDeclaration_04.groovy');
-        TestUtils.doTest('core/PackageDeclaration_05.groovy');
-        TestUtils.doTest('core/PackageDeclaration_06.groovy');
+        doTest('core/PackageDeclaration_01.groovy');
+        doTest('core/PackageDeclaration_02.groovy');
+        doTest('core/PackageDeclaration_03.groovy');
+        doTest('core/PackageDeclaration_04.groovy');
+        doTest('core/PackageDeclaration_05.groovy');
+        doTest('core/PackageDeclaration_06.groovy');
     }
 
     void "test groovy core - ImportDeclaration"() {
-        TestUtils.doTest('core/ImportDeclaration_01.groovy');
-        TestUtils.doTest('core/ImportDeclaration_02.groovy');
-        TestUtils.doTest('core/ImportDeclaration_03.groovy');
-        TestUtils.doTest('core/ImportDeclaration_04.groovy');
-        TestUtils.doTest('core/ImportDeclaration_05.groovy');
-        TestUtils.doTest('core/ImportDeclaration_06.groovy');
-        TestUtils.doTest('core/ImportDeclaration_07.groovy');
-        TestUtils.doTest('core/ImportDeclaration_08.groovy');
+        doTest('core/ImportDeclaration_01.groovy');
+        doTest('core/ImportDeclaration_02.groovy');
+        doTest('core/ImportDeclaration_03.groovy');
+        doTest('core/ImportDeclaration_04.groovy');
+        doTest('core/ImportDeclaration_05.groovy');
+        doTest('core/ImportDeclaration_06.groovy');
+        doTest('core/ImportDeclaration_07.groovy');
+        doTest('core/ImportDeclaration_08.groovy');
     }
 
     void "test groovy core - Annotation"() {
-        TestUtils.doTest('core/Annotation_01.groovy');
-        TestUtils.doTest('core/Annotation_02.groovy');
-        TestUtils.doTest('core/Annotation_03.groovy');
-        TestUtils.doTest('core/Annotation_04.groovy');
-        TestUtils.doTest('core/Annotation_05.groovy');
-        TestUtils.doTest('core/Annotation_06.groovy');
-        TestUtils.doTest('core/Annotation_07.groovy');
-        TestUtils.doTest('core/Annotation_08.groovy');
-        TestUtils.doTest('core/Annotation_09.groovy');
-        TestUtils.doRunAndTest('core/Annotation_10x.groovy');
+        doTest('core/Annotation_01.groovy');
+        doTest('core/Annotation_02.groovy');
+        doTest('core/Annotation_03.groovy');
+        doTest('core/Annotation_04.groovy');
+        doTest('core/Annotation_05.groovy');
+        doTest('core/Annotation_06.groovy');
+        doTest('core/Annotation_07.groovy');
+        doTest('core/Annotation_08.groovy');
+        doTest('core/Annotation_09.groovy');
+        doRunAndTest('core/Annotation_10x.groovy');
     }
 
     void "test groovy core - Literal"() {
-        TestUtils.doTest('core/Literal_01.groovy');
-        TestUtils.doTest('core/Literal_02.groovy', [ExpressionStatement]);
-        TestUtils.doTest('core/Literal_03.groovy');
+        doTest('core/Literal_01.groovy');
+        doTest('core/Literal_02.groovy', [ExpressionStatement]);
+        doTest('core/Literal_03.groovy');
     }
 
     void "test groovy core - GString"() {
-        TestUtils.doTest('core/GString_01.groovy');
-        TestUtils.doTest('core/GString_02.groovy');
-        TestUtils.doTest('core/GString_03.groovy');
-        TestUtils.doTest('core/GString_04.groovy');
-        TestUtils.doTest('core/GString_05.groovy');
-        TestUtils.doTest('core/GString_06.groovy');
+        doTest('core/GString_01.groovy');
+        doTest('core/GString_02.groovy');
+        doTest('core/GString_03.groovy');
+        doTest('core/GString_04.groovy');
+        doTest('core/GString_05.groovy');
+        doTest('core/GString_06.groovy');
     }
 
     void "test groovy core - Closure"() {
-        TestUtils.doTest('core/Closure_01.groovy');
-        TestUtils.doTest('core/Closure_02.groovy');
-        TestUtils.doTest('core/Closure_03.groovy');
-        TestUtils.doTest('core/Closure_04.groovy');
-        TestUtils.doTest('core/Closure_05.groovy', [Parameter]);
-        TestUtils.doTest('core/Closure_06.groovy', [Parameter]);
-        TestUtils.doTest('core/Closure_07.groovy', [Parameter]);
-        TestUtils.doTest('core/Closure_08.groovy', [Parameter]);
-        TestUtils.doTest('core/Closure_09.groovy', [Parameter]);
-        TestUtils.doTest('core/Closure_10.groovy', [Parameter]);
+        doTest('core/Closure_01.groovy');
+        doTest('core/Closure_02.groovy');
+        doTest('core/Closure_03.groovy');
+        doTest('core/Closure_04.groovy');
+        doTest('core/Closure_05.groovy', [Parameter]);
+        doTest('core/Closure_06.groovy', [Parameter]);
+        doTest('core/Closure_07.groovy', [Parameter]);
+        doTest('core/Closure_08.groovy', [Parameter]);
+        doTest('core/Closure_09.groovy', [Parameter]);
+        doTest('core/Closure_10.groovy', [Parameter]);
     }
 
     void "test groovy core - Lambda"() {
-        TestUtils.doRunAndTest('core/Lambda_01x.groovy');
+        doRunAndTest('core/Lambda_01x.groovy');
     }
 
     void "test groovy core - MethodReference"() {
-        TestUtils.doRunAndTest('core/MethodReference_01x.groovy');
+        doRunAndTest('core/MethodReference_01x.groovy');
     }
 
     void "test groovy core - MethodPointer"() {
-        TestUtils.doRunAndTest('core/MethodPointer_01x.groovy');
+        doRunAndTest('core/MethodPointer_01x.groovy');
     }
 
     void "test groovy core - ElvisAssignment"() {
-        TestUtils.doRunAndTest('core/ElvisAssignment_01x.groovy');
+        doRunAndTest('core/ElvisAssignment_01x.groovy');
     }
 
     void "test groovy core - List"() {
-        TestUtils.doTest('core/List_01.groovy');
+        doTest('core/List_01.groovy');
     }
 
     void "test groovy core - Map"() {
-        TestUtils.doTest('core/Map_01.groovy');
+        doTest('core/Map_01.groovy');
     }
 
     void "test groovy core - Expression"() {
-        TestUtils.doTest('core/Expression_01.groovy');
-        TestUtils.doTest('core/Expression_02.groovy');
-        TestUtils.doTest('core/Expression_03.groovy');
-        TestUtils.doTest('core/Expression_04.groovy');
-        TestUtils.doTest('core/Expression_05.groovy');
-        TestUtils.doTest('core/Expression_06.groovy');
-        TestUtils.doTest('core/Expression_07.groovy');
-        TestUtils.doTest('core/Expression_08.groovy');
-        TestUtils.doTest('core/Expression_09.groovy');
-        TestUtils.doTest('core/Expression_10.groovy');
-        TestUtils.doTest('core/Expression_11.groovy');
-        TestUtils.doTest('core/Expression_12.groovy');
-        TestUtils.doTest('core/Expression_13.groovy');
-        TestUtils.doTest('core/Expression_14.groovy');
-        TestUtils.doTest('core/Expression_15.groovy');
-        TestUtils.doTest('core/Expression_16.groovy', [Parameter, ExpressionStatement]);
-        TestUtils.doTest('core/Expression_17.groovy');
-        TestUtils.doTest('core/Expression_18.groovy');
-        TestUtils.doTest('core/Expression_19.groovy');
-        TestUtils.doTest('core/Expression_20.groovy');
-        TestUtils.doRunAndTest('core/Expression_21x.groovy');
-        TestUtils.doTest('core/Expression_22x.groovy');
-        TestUtils.doRunAndTest('core/Expression_22x.groovy');
-        TestUtils.doRunAndTest('core/Expression_23x.groovy');
+        doTest('core/Expression_01.groovy');
+        doTest('core/Expression_02.groovy');
+        doTest('core/Expression_03.groovy');
+        doTest('core/Expression_04.groovy');
+        doTest('core/Expression_05.groovy');
+        doTest('core/Expression_06.groovy');
+        doTest('core/Expression_07.groovy');
+        doTest('core/Expression_08.groovy');
+        doTest('core/Expression_09.groovy');
+        doTest('core/Expression_10.groovy');
+        doTest('core/Expression_11.groovy');
+        doTest('core/Expression_12.groovy');
+        doTest('core/Expression_13.groovy');
+        doTest('core/Expression_14.groovy');
+        doTest('core/Expression_15.groovy');
+        doTest('core/Expression_16.groovy', [Parameter, ExpressionStatement]);
+        doTest('core/Expression_17.groovy');
+        doTest('core/Expression_18.groovy');
+        doTest('core/Expression_19.groovy');
+        doTest('core/Expression_20.groovy');
+        doRunAndTest('core/Expression_21x.groovy');
+        doTest('core/Expression_22x.groovy');
+        doRunAndTest('core/Expression_22x.groovy');
+        doRunAndTest('core/Expression_23x.groovy');
     }
 
     void "test groovy core - IdenticalOp"() {
-        TestUtils.doRunAndTest('core/IdenticalOp_01x.groovy');
+        doRunAndTest('core/IdenticalOp_01x.groovy');
     }
 
     void "test groovy core - Assert"() {
-        TestUtils.doTest('core/Assert_01.groovy');
-        TestUtils.doRunAndTest('core/Assert_02x.groovy');
-        TestUtils.doRunAndTest('core/Assert_03x.groovy');
+        doTest('core/Assert_01.groovy');
+        doRunAndTest('core/Assert_02x.groovy');
+        doRunAndTest('core/Assert_03x.groovy');
     }
 
     void "test groovy core - IfElse"() {
-        TestUtils.doTest('core/IfElse_01.groovy', [AssertStatement]);
+        doTest('core/IfElse_01.groovy', [AssertStatement]);
     }
 
     void "test groovy core - For"() {
-        TestUtils.doTest('core/For_01.groovy', [AssertStatement]);
-        TestUtils.doTest('core/For_02.groovy');
-        TestUtils.doTest('core/For_03.groovy');
-        TestUtils.doRunAndTest('core/For_04x.groovy');
-        TestUtils.doRunAndTest('core/For_05x.groovy');
+        doTest('core/For_01.groovy', [AssertStatement]);
+        doTest('core/For_02.groovy');
+        doTest('core/For_03.groovy');
+        doRunAndTest('core/For_04x.groovy');
+        doRunAndTest('core/For_05x.groovy');
     }
 
     void "test groovy core - While"() {
-        TestUtils.doTest('core/While_01.groovy');
-        TestUtils.doRunAndTest('core/While_02x.groovy');
+        doTest('core/While_01.groovy');
+        doRunAndTest('core/While_02x.groovy');
     }
 
     void "test groovy core - CodeBlock"() {
-        TestUtils.doRunAndTest('core/CodeBlock_01x.groovy');
+        doRunAndTest('core/CodeBlock_01x.groovy');
     }
 
     void "test groovy core - DoWhile"() {
-        TestUtils.doRunAndTest('core/DoWhile_01x.groovy');
-        TestUtils.doRunAndTest('core/DoWhile_02x.groovy');
-        TestUtils.doRunAndTest('core/DoWhile_03x.groovy');
-        TestUtils.doRunAndTest('core/DoWhile_04x.groovy');
+        doRunAndTest('core/DoWhile_01x.groovy');
+        doRunAndTest('core/DoWhile_02x.groovy');
+        doRunAndTest('core/DoWhile_03x.groovy');
+        doRunAndTest('core/DoWhile_04x.groovy');
     }
 
 
     void "test groovy core - TryCatch"() {
-        TestUtils.doTest('core/TryCatch_01.groovy');
+        doTest('core/TryCatch_01.groovy');
     }
 
     void "test groovy core - TryWithResources"() {
-        TestUtils.doRunAndTest('core/TryWithResources_01x.groovy');
+        doRunAndTest('core/TryWithResources_01x.groovy');
     }
 
     void "test groovy core - SafeIndex"() {
-        TestUtils.doRunAndTest('core/SafeIndex_01x.groovy');
-        TestUtils.doRunAndTest('core/SafeIndex_02x.groovy');
-        TestUtils.doRunAndTest('core/SafeIndex_03x.groovy');
+        doRunAndTest('core/SafeIndex_01x.groovy');
+        doRunAndTest('core/SafeIndex_02x.groovy');
+        doRunAndTest('core/SafeIndex_03x.groovy');
     }
 
     void "test groovy core - NegativeRelationalOperators"() {
-        TestUtils.doRunAndTest('core/NegativeRelationalOperators_01x.groovy');
-        TestUtils.doRunAndTest('core/NegativeRelationalOperators_02x.groovy');
+        doRunAndTest('core/NegativeRelationalOperators_01x.groovy');
+        doRunAndTest('core/NegativeRelationalOperators_02x.groovy');
     }
 
     void "test groovy core - DefaultMethod"() {
-        TestUtils.doRunAndTest('core/DefaultMethod_01x.groovy');
-        TestUtils.doRunAndTest('core/DefaultMethod_02x.groovy');
+        doRunAndTest('core/DefaultMethod_01x.groovy');
+        doRunAndTest('core/DefaultMethod_02x.groovy');
     }
 
 
     void "test groovy core - Switch"() {
-        TestUtils.doTest('core/Switch_01.groovy');
+        doTest('core/Switch_01.groovy');
     }
 
     void "test groovy core - Synchronized"() {
-        TestUtils.doTest('core/Synchronized_01.groovy');
+        doTest('core/Synchronized_01.groovy');
     }
 
     void "test groovy core - Return"() {
-        TestUtils.doTest('core/Return_01.groovy');
+        doTest('core/Return_01.groovy');
     }
 
     void "test groovy core - Throw"() {
-        TestUtils.doTest('core/Throw_01.groovy');
+        doTest('core/Throw_01.groovy');
     }
 
     void "test groovy core - Label"() {
-        TestUtils.doTest('core/Label_01.groovy');
+        doTest('core/Label_01.groovy');
     }
 
     void "test groovy core - LocalVariableDeclaration"() {
-        TestUtils.doTest('core/LocalVariableDeclaration_01.groovy', [Token]); // [class org.codehaus.groovy.syntax.Token][startLine]:: 9 != 8
+        doTest('core/LocalVariableDeclaration_01.groovy', [Token]); // [class org.codehaus.groovy.syntax.Token][startLine]:: 9 != 8
     }
 
     void "test groovy core - MethodDeclaration"() {
-        TestUtils.doTest('core/MethodDeclaration_01.groovy');
-        TestUtils.doTest('core/MethodDeclaration_02.groovy');
+        doTest('core/MethodDeclaration_01.groovy');
+        doTest('core/MethodDeclaration_02.groovy');
     }
 
     void "test groovy core - ClassDeclaration"() {
-        TestUtils.doTest('core/ClassDeclaration_01.groovy');
-        TestUtils.doTest('core/ClassDeclaration_02.groovy');
-        TestUtils.doTest('core/ClassDeclaration_03.groovy');
-        TestUtils.doTest('core/ClassDeclaration_04.groovy', [PropertyNode, FieldNode]);
-        TestUtils.doTest('core/ClassDeclaration_05.groovy', [ExpressionStatement]);
-        TestUtils.doTest('core/ClassDeclaration_06.groovy');
-        TestUtils.doTest('core/ClassDeclaration_07.groovy');
+        doTest('core/ClassDeclaration_01.groovy');
+        doTest('core/ClassDeclaration_02.groovy');
+        doTest('core/ClassDeclaration_03.groovy');
+        doTest('core/ClassDeclaration_04.groovy', [PropertyNode, FieldNode]);
+        doTest('core/ClassDeclaration_05.groovy', [ExpressionStatement]);
+        doTest('core/ClassDeclaration_06.groovy');
+        doTest('core/ClassDeclaration_07.groovy');
     }
 
     void "test groovy core - InterfaceDeclaration"() {
-        TestUtils.doTest('core/InterfaceDeclaration_01.groovy');
-        TestUtils.doTest('core/InterfaceDeclaration_02.groovy');
-        TestUtils.doTest('core/InterfaceDeclaration_03.groovy');
+        doTest('core/InterfaceDeclaration_01.groovy');
+        doTest('core/InterfaceDeclaration_02.groovy');
+        doTest('core/InterfaceDeclaration_03.groovy');
     }
 
     void "test groovy core - EnumDeclaration"() {
-        TestUtils.doTest('core/EnumDeclaration_01.groovy');
-        TestUtils.doTest('core/EnumDeclaration_02.groovy', [ExpressionStatement]);
-        TestUtils.doTest('core/EnumDeclaration_03.groovy');
-        TestUtils.doTest('core/EnumDeclaration_04.groovy');
-        TestUtils.doTest('core/EnumDeclaration_05.groovy');
+        doTest('core/EnumDeclaration_01.groovy');
+        doTest('core/EnumDeclaration_02.groovy', [ExpressionStatement]);
+        doTest('core/EnumDeclaration_03.groovy');
+        doTest('core/EnumDeclaration_04.groovy');
+        doTest('core/EnumDeclaration_05.groovy');
     }
 
     void "test groovy core - TraitDeclaration"() {
-        TestUtils.doTest('core/TraitDeclaration_01.groovy');
-        TestUtils.doTest('core/TraitDeclaration_02.groovy');
-        TestUtils.doTest('core/TraitDeclaration_03.groovy');
-        TestUtils.doTest('core/TraitDeclaration_04.groovy', [PropertyNode, FieldNode]);
-        TestUtils.doTest('core/TraitDeclaration_05.groovy');
+        doTest('core/TraitDeclaration_01.groovy');
+        doTest('core/TraitDeclaration_02.groovy');
+        doTest('core/TraitDeclaration_03.groovy');
+        doTest('core/TraitDeclaration_04.groovy', [PropertyNode, FieldNode]);
+        doTest('core/TraitDeclaration_05.groovy');
     }
 
     void "test groovy core - AnnotationDeclaration"() {
-        TestUtils.doTest('core/AnnotationDeclaration_01.groovy');
+        doTest('core/AnnotationDeclaration_01.groovy');
     }
 
     void "test groovy core - Command"() {
-        TestUtils.doTest('core/Command_01.groovy');
-        TestUtils.doTest('core/Command_02.groovy');
-        TestUtils.doTest('core/Command_03.groovy', [ExpressionStatement, Parameter]);
-        TestUtils.doTest('core/Command_04.groovy', [ExpressionStatement]);
-        TestUtils.doTest('core/Command_05.groovy');
-        TestUtils.doRunAndTest('core/Command_06x.groovy')
+        doTest('core/Command_01.groovy');
+        doTest('core/Command_02.groovy');
+        doTest('core/Command_03.groovy', [ExpressionStatement, Parameter]);
+        doTest('core/Command_04.groovy', [ExpressionStatement]);
+        doTest('core/Command_05.groovy');
+        doRunAndTest('core/Command_06x.groovy')
     }
 
     void "test groovy core - Unicode"() {
-        TestUtils.doTest('core/Unicode_01.groovy');
+        doTest('core/Unicode_01.groovy');
     }
 
     void "test groovy core - BreakingChanges"() {
-        TestUtils.doRunAndTest('core/BreakingChange_01x.groovy');
-        TestUtils.doRunAndTest('core/BreakingChange_02x.groovy');
-        TestUtils.doRunAndTest('core/BreakingChange_03x.groovy');
-        TestUtils.doRunAndTest('core/BreakingChange_04x.groovy');
+        doRunAndTest('core/BreakingChange_01x.groovy');
+        doRunAndTest('core/BreakingChange_02x.groovy');
+        doRunAndTest('core/BreakingChange_03x.groovy');
+        doRunAndTest('core/BreakingChange_04x.groovy');
     }
 
     void "test groovy core - Array"() {
-        TestUtils.doRunAndTest('core/Array_01x.groovy');
+        doRunAndTest('core/Array_01x.groovy');
     }
 
     void "test groovy core - Groovydoc"() {
-        TestUtils.doRunAndTest('core/Groovydoc_01x.groovy');
+        doRunAndTest('core/Groovydoc_01x.groovy');
     }
 
     void "test groovy core - Script"() {
-        TestUtils.doRunAndTest('core/Script_01x.groovy');
+        doRunAndTest('core/Script_01x.groovy');
     }
 
     void "test groovy core - BUG"() {
-        TestUtils.doRunAndTest('bugs/BUG-GROOVY-4757.groovy');
-        TestUtils.doRunAndTest('bugs/GROOVY-3898.groovy');
-        TestUtils.doRunAndTest('bugs/BUG-GROOVY-5652.groovy');
-        TestUtils.doRunAndTest('bugs/BUG-GROOVY-4762.groovy');
-        TestUtils.doRunAndTest('bugs/BUG-GROOVY-4438.groovy');
-        TestUtils.doRunAndTest('bugs/BUG-GROOVY-6038.groovy');
-        TestUtils.doRunAndTest('bugs/BUG-GROOVY-2324.groovy');
+        doRunAndTest('bugs/BUG-GROOVY-4757.groovy');
+        doRunAndTest('bugs/GROOVY-3898.groovy');
+        doRunAndTest('bugs/BUG-GROOVY-5652.groovy');
+        doRunAndTest('bugs/BUG-GROOVY-4762.groovy');
+        doRunAndTest('bugs/BUG-GROOVY-4438.groovy');
+        doRunAndTest('bugs/BUG-GROOVY-6038.groovy');
+        doRunAndTest('bugs/BUG-GROOVY-2324.groovy');
+        doTest('bugs/BUG-GROOVY-8161.groovy');
     }
 }

http://git-wip-us.apache.org/repos/asf/groovy/blob/07456a51/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8161.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8161.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8161.groovy
new file mode 100644
index 0000000..c7913ed
--- /dev/null
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8161.groovy
@@ -0,0 +1,2 @@
+for (foo in []) {;
+}
\ No newline at end of file

12345
Loading...