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 2018/05/28 21:07:05 UTC
groovy git commit: add @since tag plus minor javadoc changes
Repository: groovy
Updated Branches:
refs/heads/master 7d5e34454 -> 07d14aa44
add @since tag plus minor javadoc changes
Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/07d14aa4
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/07d14aa4
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/07d14aa4
Branch: refs/heads/master
Commit: 07d14aa44a2aa28d64655b828b5a0a7cd83d7ba4
Parents: 7d5e344
Author: Paul King <pa...@asert.com.au>
Authored: Tue May 29 07:06:35 2018 +1000
Committer: Paul King <pa...@asert.com.au>
Committed: Tue May 29 07:07:00 2018 +1000
----------------------------------------------------------------------
gradle/pomconfigurer.gradle | 3 +++
src/main/groovy/groovy/lang/Newify.java | 16 ++++++++++------
2 files changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/groovy/blob/07d14aa4/gradle/pomconfigurer.gradle
----------------------------------------------------------------------
diff --git a/gradle/pomconfigurer.gradle b/gradle/pomconfigurer.gradle
index 31ea58a..33c62d3 100644
--- a/gradle/pomconfigurer.gradle
+++ b/gradle/pomconfigurer.gradle
@@ -630,6 +630,9 @@ project.ext.pomConfigureClosureWithoutTweaks = {
contributor {
name 'Remko Popma'
}
+ contributor {
+ name 'mgroovy'
+ }
}
mailingLists {
mailingList {
http://git-wip-us.apache.org/repos/asf/groovy/blob/07d14aa4/src/main/groovy/groovy/lang/Newify.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/groovy/lang/Newify.java b/src/main/groovy/groovy/lang/Newify.java
index 023a0b3..a925bd1 100644
--- a/src/main/groovy/groovy/lang/Newify.java
+++ b/src/main/groovy/groovy/lang/Newify.java
@@ -31,7 +31,7 @@ import java.lang.annotation.Target;
* method or "Python-style" by just omitting the 'new' keyword.
* <p>
* WARNING: For the Python style with class-name-matching pattern, the pattern should be chosen as to avoid matching
- * method names if possible. If following Java/Groovy naming convention, class names (contrary to method names) start
+ * method names if possible. If following Java/Groovy naming conventions, class names (contrary to method names) start
* with an uppercase letter. In this case {@code pattern="[A-Z].*"} (see {@link java.util.regex.Pattern} for supported
* Java pattern syntax) is the recommended pattern to allow all classes to be created without requiring a new keyword.
* Using a pattern that also matches method names (e.g. ".+", ".*" or "[a-zA-Z].*") might negatively impact build
@@ -77,8 +77,8 @@ import java.lang.annotation.Target;
* using meta programming.
* <p>
* For the "Python-style" conversions you can either specify each class name on which you want them
- * to apply, or supply a pattern to match class names against. The transformation then works by matching the basename
- * of the provided classes to any
+ * to apply, or supply a pattern to match class names against. The transformation then works by
+ * matching the basename of the provided classes to any
* similarly named instance method calls not specifically bound to an object, i.e. associated
* with the 'this' object. In other words <code>Leaf("A")</code> would be transformed to
* <code>new Leaf("A")</code> but <code>x.Leaf("A")</code> would not be touched.
@@ -110,15 +110,15 @@ import java.lang.annotation.Target;
* Though it is OK to have different packages in different contexts. Also, there is
* no support for turning "Ruby-style" conversions off at the method, constructor or
* field level if already turned on at the class level.
- *
- * @author Paul King
- * @author mgroovy
*/
@java.lang.annotation.Documented
@Retention(RetentionPolicy.SOURCE)
@Target({ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.TYPE, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
@GroovyASTTransformationClass("org.codehaus.groovy.transform.NewifyASTTransformation")
public @interface Newify {
+ /**
+ * @return one or more classes where "Python-style" constructor notation will be supported
+ */
Class<?>[] value() default {};
/**
@@ -126,5 +126,9 @@ public @interface Newify {
*/
boolean auto() default true;
+ /**
+ * @since 2.5.0
+ * @return a regex pattern for class names where "Python-style" constructor notation will be supported
+ */
String pattern() default "";
}