This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/master by this push:
new 6cbd89e739 minor refactor for consistency: we use no-arg in most
places and used no-args in just a few (mostly in comments and doco but also one
error message)
6cbd89e739 is described below
commit 6cbd89e7399621fb40712f1b2cfeebe5d823a806
Author: Paul King <[email protected]>
AuthorDate: Sat Jul 8 10:04:55 2023 +1000
minor refactor for consistency: we use no-arg in most places and used
no-args in just a few (mostly in comments and doco but also one error message)
---
src/main/java/groovy/lang/GroovyShell.java | 4 ++--
src/main/java/groovy/util/FactoryBuilderSupport.java | 4 ++--
.../org/codehaus/groovy/transform/NamedVariantASTTransformation.java | 2 +-
src/spec/doc/core-metaprogramming.adoc | 2 +-
src/spec/doc/core-object-orientation.adoc | 2 +-
.../src/test/groovy/org/codehaus/groovy/macro/MacroTest.groovy | 2 +-
6 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/main/java/groovy/lang/GroovyShell.java
b/src/main/java/groovy/lang/GroovyShell.java
index e167823d04..1498857b03 100644
--- a/src/main/java/groovy/lang/GroovyShell.java
+++ b/src/main/java/groovy/lang/GroovyShell.java
@@ -265,8 +265,8 @@ public class GroovyShell extends GroovyObjectSupport {
* } else if (theClass implements Runnable) {
* if (theClass has a constructor with String[] params)
* instantiate theClass with this constructor and run
- * else if (theClass has a no-args constructor)
- * instantiate theClass with the no-args constructor and run
+ * else if (theClass has a no-arg constructor)
+ * instantiate theClass with the no-arg constructor and run
* }
*/
private Object runScriptOrMainOrTestOrRunnable(Class scriptClass, String[]
args) {
diff --git a/src/main/java/groovy/util/FactoryBuilderSupport.java
b/src/main/java/groovy/util/FactoryBuilderSupport.java
index 1f79de791d..6891392c07 100644
--- a/src/main/java/groovy/util/FactoryBuilderSupport.java
+++ b/src/main/java/groovy/util/FactoryBuilderSupport.java
@@ -635,7 +635,7 @@ public abstract class FactoryBuilderSupport extends Binding
{
/**
* Registers a factory for a JavaBean.<br>
- * The JavaBean class should have a no-args constructor.
+ * The JavaBean class should have a no-arg constructor.
*
* @param theName name of the node
* @param beanClass the factory to handle the name
@@ -646,7 +646,7 @@ public abstract class FactoryBuilderSupport extends Binding
{
/**
* Registers a factory for a JavaBean.<br>
- * The JavaBean class should have a no-args constructor.
+ * The JavaBean class should have a no-arg constructor.
*
* @param theName name of the node
* @param groupName thr group to register this node in
diff --git
a/src/main/java/org/codehaus/groovy/transform/NamedVariantASTTransformation.java
b/src/main/java/org/codehaus/groovy/transform/NamedVariantASTTransformation.java
index 6a15eb0035..9379c0dd1c 100644
---
a/src/main/java/org/codehaus/groovy/transform/NamedVariantASTTransformation.java
+++
b/src/main/java/org/codehaus/groovy/transform/NamedVariantASTTransformation.java
@@ -98,7 +98,7 @@ public class NamedVariantASTTransformation extends
AbstractASTTransformation {
Parameter[] mNodeParams = mNode.getParameters();
if (mNodeParams.length == 0) {
- addError("Error during " + NAMED_VARIANT + " processing. No-args
method not supported.", mNode);
+ addError("Error during " + NAMED_VARIANT + " processing. No-arg
methods aren't supported.", mNode);
return;
}
diff --git a/src/spec/doc/core-metaprogramming.adoc
b/src/spec/doc/core-metaprogramming.adoc
index e752d029de..ff7af86710 100644
--- a/src/spec/doc/core-metaprogramming.adoc
+++ b/src/spec/doc/core-metaprogramming.adoc
@@ -3026,7 +3026,7 @@ There are two kinds of transformations: global and local
transformations.
wherever the transformation apply. Compiled classes that implement global
transformations
are in a JAR added to the classpath of the compiler and contain service
locator file
`META-INF/services/org.codehaus.groovy.transform.ASTTransformation` with a
line with the name of the
-transformation class. The transformation class must have a no-args constructor
and implement the
+transformation class. The transformation class must have a no-arg constructor
and implement the
`org.codehaus.groovy.transform.ASTTransformation` interface.
It will be run against *every source in the compilation*, so be sure to not
create transformations which
scan all the AST in an expansive and time-consuming manner, to keep the
compiler fast.
diff --git a/src/spec/doc/core-object-orientation.adoc
b/src/spec/doc/core-object-orientation.adoc
index 65d5a19a9a..95da6d4d92 100644
--- a/src/spec/doc/core-object-orientation.adoc
+++ b/src/spec/doc/core-object-orientation.adoc
@@ -1048,7 +1048,7 @@
include::../test/ClassTest.groovy[tags=closure_ann_runner,indent=0]
<1> create a new instance of the class passed as an argument (the task class)
<2> emulate an environment which is JDK 6 and not Windows
<3> iterate on all declared methods of the task class
-<4> if the method is public and takes no-argument
+<4> if the method is public and takes no arguments
<5> try to find the `@OnlyIf` annotation
<6> if it is found get the `value` and create a new `Closure` out of it
<7> set the `delegate` of the closure to our environment variable
diff --git
a/subprojects/groovy-macro/src/test/groovy/org/codehaus/groovy/macro/MacroTest.groovy
b/subprojects/groovy-macro/src/test/groovy/org/codehaus/groovy/macro/MacroTest.groovy
index 0ec95153b9..7d24d725d1 100644
---
a/subprojects/groovy-macro/src/test/groovy/org/codehaus/groovy/macro/MacroTest.groovy
+++
b/subprojects/groovy-macro/src/test/groovy/org/codehaus/groovy/macro/MacroTest.groovy
@@ -218,7 +218,7 @@ class MacroTest extends GroovyTestCase {
void testNotAMacroCall() {
// FIXME should fail with "MissingMethodException" because none of
MacroGroovy extension methods
- // are defined with "no-args" version
+ // are defined with a "no-arg" variant
shouldFail(MethodSelectionException) {
assertScript 'macro()'
}