You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2022/06/11 01:07:00 UTC

[groovy] branch GROOVY_4_0_X updated (29c1814d2c -> 0b5e00ed45)

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

paulk pushed a change to branch GROOVY_4_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git


    from 29c1814d2c GROOVY-10654: `ASTTransformationCustomizer`: enum and array parameters
     new b28c2803cc whitespace cleanup
     new 416ba7923d fix spelling of "explicitly"
     new 0b5e00ed45 Fix missleading error message in GroovyScriptEngine

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


Summary of changes:
 src/main/java/groovy/util/GroovyScriptEngine.java      |  2 +-
 .../groovy/transform/NewifyASTTransformation.java      |  2 +-
 src/spec/doc/core-syntax.adoc                          | 18 +++++++++---------
 src/test/gls/syntax/Gep3OrderDslTest.groovy            |  6 +++---
 4 files changed, 14 insertions(+), 14 deletions(-)


[groovy] 03/03: Fix missleading error message in GroovyScriptEngine

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch GROOVY_4_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 0b5e00ed45aee6169718b2e55af2d72f2514de95
Author: aalku <aa...@gmail.com>
AuthorDate: Fri Jun 10 14:22:28 2022 +0200

    Fix missleading error message in GroovyScriptEngine
    
    The error message is missleading and needs a fix. Otherwise it can show "Cannot open URL: folderfile" instead of "folder/file" and the user might wonder why is it looking for "folderfile".
---
 src/main/java/groovy/util/GroovyScriptEngine.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/groovy/util/GroovyScriptEngine.java b/src/main/java/groovy/util/GroovyScriptEngine.java
index 1a4c367ba4..d5a10838e4 100644
--- a/src/main/java/groovy/util/GroovyScriptEngine.java
+++ b/src/main/java/groovy/util/GroovyScriptEngine.java
@@ -383,7 +383,7 @@ public class GroovyScriptEngine implements ResourceConnector {
                     se = new ResourceException(message, se);
                 }
             } catch (IOException e1) {
-                String message = "Cannot open URL: " + root + resourceName;
+                String message = "Cannot open URL: " + root + ", " + resourceName;
                 groovyScriptConn = null;
                 if (se == null) {
                     se = new ResourceException(message);


[groovy] 01/03: whitespace cleanup

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch GROOVY_4_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit b28c2803ccab11634b54c5129153054efc91ffeb
Author: Kenyon Ralph <qu...@quicinc.com>
AuthorDate: Wed Jun 1 16:36:49 2022 -0700

    whitespace cleanup
---
 src/spec/doc/core-syntax.adoc               | 14 +++++++-------
 src/test/gls/syntax/Gep3OrderDslTest.groovy |  4 ++--
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/spec/doc/core-syntax.adoc b/src/spec/doc/core-syntax.adoc
index a60cff8048..263768bac6 100644
--- a/src/spec/doc/core-syntax.adoc
+++ b/src/spec/doc/core-syntax.adoc
@@ -373,7 +373,7 @@ We'll see some more escaping details when it comes to other types of strings dis
 
 ==== Unicode escape sequence
 
-For characters that are not present on your keyboard, you can use unicode escape sequences: 
+For characters that are not present on your keyboard, you can use unicode escape sequences:
 a backslash, followed by 'u', then 4 hexadecimal digits.
 
 For example, the Euro currency symbol can be represented with:
@@ -423,7 +423,7 @@ include::../test/SyntaxTest.groovy[tags=gstring_2,indent=0]
 
 [NOTE]
 Not only are expressions allowed in between the `${}` placeholder, but so are statements. However, a statement's value is just `null`.
-So if several statements are inserted in that placeholder, the last one should somehow return a meaningful value to be inserted. 
+So if several statements are inserted in that placeholder, the last one should somehow return a meaningful value to be inserted.
 For instance, +"The sum of 1 and 2 is equal to ${def a = 1; def b = 2; a + b}"+ is supported and works as expected but a good practice is usually to stick to simple expressions inside GString placeholders.
 
 In addition to `${}` placeholders, we can also use a lone `$` sign prefixing a dotted expression:
@@ -555,7 +555,7 @@ NOTE: Neither double quotes nor single quotes need be escaped in triple-double-q
 === Slashy string
 
 Beyond the usual quoted strings, Groovy offers slashy strings, which use `/` as the opening and closing delimiter.
-Slashy strings are particularly useful for defining regular expressions and patterns, 
+Slashy strings are particularly useful for defining regular expressions and patterns,
 as there is no need to escape backslashes.
 
 Example of a slashy string:
@@ -588,7 +588,7 @@ include::../test/SyntaxTest.groovy[tags=slashy_4,indent=0]
 
 ==== Special cases
 
-An empty slashy string cannot be represented with a double forward slash, as it's understood by the Groovy parser as a line comment. 
+An empty slashy string cannot be represented with a double forward slash, as it's understood by the Groovy parser as a line comment.
 That's why the following assert would actually not compile as it would look like a non-terminated statement:
 
 [source,groovy]
@@ -732,7 +732,7 @@ include::../test/SyntaxTest.groovy[tags=list_2,indent=0]
 <1> Our list here contains a number, a string and a boolean value
 
 We mentioned that by default, list literals are actually instances of `java.util.ArrayList`,
-but it is possible to use a different backing type for our lists, 
+but it is possible to use a different backing type for our lists,
 thanks to using type coercion with the `as` operator, or with explicit type declaration for your variables:
 
 [source,groovy]
@@ -827,7 +827,7 @@ assert groovyBooks.every{ it.contains('Groovy') }
 == Maps
 
 Sometimes called dictionaries or associative arrays in other languages, Groovy features maps.
-Maps associate keys to values, separating keys and values with colons, and each key/value pairs with commas, 
+Maps associate keys to values, separating keys and values with colons, and each key/value pairs with commas,
 and the whole keys and values surrounded by square brackets.
 
 [source,groovy]
@@ -876,7 +876,7 @@ include::../test/SyntaxTest.groovy[tags=variable_key_1,indent=0]
 
 [NOTE]
 You can also pass quoted strings as well as keys: +["name": "Guillaume"]+.
-This is mandatory if your key string isn't a valid identifier, 
+This is mandatory if your key string isn't a valid identifier,
 for example if you wanted to create a string key containing a dash like in: +["street-name": "Main street"]+.
 
 When you need to pass variable values as keys in your map definitions, you must surround the variable or expression with parentheses:
diff --git a/src/test/gls/syntax/Gep3OrderDslTest.groovy b/src/test/gls/syntax/Gep3OrderDslTest.groovy
index 8e5948fe2d..bfd2f3c31b 100644
--- a/src/test/gls/syntax/Gep3OrderDslTest.groovy
+++ b/src/test/gls/syntax/Gep3OrderDslTest.groovy
@@ -77,7 +77,7 @@ class Gep3OrderDslTest extends GroovyTestCase {
         assert orders[1].allOrNone == true
         assert orders[1].limitPrice == 80
         assert orders[1].quantity == 150
-        assert orders[1].security.name == 'VMW' 
+        assert orders[1].security.name == 'VMW'
     }
 }
 
@@ -187,4 +187,4 @@ class CustomBinding extends Binding {
         // like "to" and "the" in our DSL
         null
     }
-}
\ No newline at end of file
+}


[groovy] 02/03: fix spelling of "explicitly"

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch GROOVY_4_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 416ba7923d5bb713a63dfcba5c4a39cef98ae076
Author: Kenyon Ralph <qu...@quicinc.com>
AuthorDate: Wed Jun 1 16:37:06 2022 -0700

    fix spelling of "explicitly"
---
 .../java/org/codehaus/groovy/transform/NewifyASTTransformation.java   | 2 +-
 src/spec/doc/core-syntax.adoc                                         | 4 ++--
 src/test/gls/syntax/Gep3OrderDslTest.groovy                           | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/codehaus/groovy/transform/NewifyASTTransformation.java b/src/main/java/org/codehaus/groovy/transform/NewifyASTTransformation.java
index 0d8eee8f3e..9ad3dafa5e 100644
--- a/src/main/java/org/codehaus/groovy/transform/NewifyASTTransformation.java
+++ b/src/main/java/org/codehaus/groovy/transform/NewifyASTTransformation.java
@@ -403,7 +403,7 @@ public class NewifyASTTransformation extends ClassCodeExpressionTransformer impl
             Expression argsToUse = argsExp;
             if (classType.getOuterClass() != null && ((classType.getModifiers() & org.objectweb.asm.Opcodes.ACC_STATIC) == 0)) {
                 if (!(argsExp instanceof ArgumentListExpression)) {
-                    addError("Non-static inner constructor arguments must be an argument list expression; pass 'this' pointer explicitely as first constructor argument otherwise.", mce);
+                    addError("Non-static inner constructor arguments must be an argument list expression; pass 'this' pointer explicitly as first constructor argument otherwise.", mce);
                     return mce;
                 }
                 final ArgumentListExpression argsListExp = (ArgumentListExpression) argsExp;
diff --git a/src/spec/doc/core-syntax.adoc b/src/spec/doc/core-syntax.adoc
index 263768bac6..f0358a4122 100644
--- a/src/spec/doc/core-syntax.adoc
+++ b/src/spec/doc/core-syntax.adoc
@@ -768,8 +768,8 @@ include::../test/SyntaxTest.groovy[tags=multi_dim_list,indent=0]
 
 == Arrays
 
-Groovy reuses the list notation for arrays, but to make such literals arrays, 
-you need to explicitely define the type of the array through coercion or type declaration.
+Groovy reuses the list notation for arrays, but to make such literals arrays,
+you need to explicitly define the type of the array through coercion or type declaration.
 
 [source,groovy]
 ----
diff --git a/src/test/gls/syntax/Gep3OrderDslTest.groovy b/src/test/gls/syntax/Gep3OrderDslTest.groovy
index bfd2f3c31b..92097615fa 100644
--- a/src/test/gls/syntax/Gep3OrderDslTest.groovy
+++ b/src/test/gls/syntax/Gep3OrderDslTest.groovy
@@ -151,7 +151,7 @@ class Order {
     /** Valuation closure: "of { qty, unitPrice -> ... }" */
     def of(Closure valueCalculation) {
         // in order to be able to define closures like { qty * unitPrice }
-        // without having to explicitely pass the parameters to the closure
+        // without having to explicitly pass the parameters to the closure
         // we can wrap the closure inside another one
         // and that closure sets a delegate to the qty and unitPrice variables
         def wrapped = { qty, unitPrice ->