GROOVY-8242: @Newify default attribute value (closes #579) Class values are only required for Python-style conversions so the attribute should default to an empty array to indicate it is not strictly required.
Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/df0f99b6 Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/df0f99b6 Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/df0f99b6 Branch: refs/heads/GROOVY_2_4_X Commit: df0f99b6bb3b81c120835da24898f934e34ee7cc Parents: 6aaea88 Author: John Wagenleitner <jwagenleit...@apache.org> Authored: Sat Aug 5 11:05:17 2017 -0700 Committer: John Wagenleitner <jwagenleit...@apache.org> Committed: Sat Aug 5 21:05:43 2017 -0700 ---------------------------------------------------------------------- src/main/groovy/lang/Newify.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/groovy/blob/df0f99b6/src/main/groovy/lang/Newify.java ---------------------------------------------------------------------- diff --git a/src/main/groovy/lang/Newify.java b/src/main/groovy/lang/Newify.java index 66edcde..5bf7fdf 100644 --- a/src/main/groovy/lang/Newify.java +++ b/src/main/groovy/lang/Newify.java @@ -28,7 +28,7 @@ import java.lang.annotation.Target; /** * Annotation that supports writing constructor call expressions without the 'new' * keyword. Instead they can be written "Ruby-style" as a method call to a 'new' - * method or "Python-style" by just omitting the keyword missing. + * method or "Python-style" by just omitting the 'new' keyword. * <p> * It allows you to write code snippets like this ("Python-style"): * <pre> @@ -100,7 +100,7 @@ import java.lang.annotation.Target; @Target({ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.TYPE, ElementType.FIELD, ElementType.LOCAL_VARIABLE}) @GroovyASTTransformationClass("org.codehaus.groovy.transform.NewifyASTTransformation") public @interface Newify { - Class[] value(); + Class<?>[] value() default {}; /** * @return if automatic conversion of "Ruby-style" new method calls should occur