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/51f92940 Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/51f92940 Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/51f92940 Branch: refs/heads/master Commit: 51f929403509229eac6c9bc92400e4573cc1768a Parents: faf1ece 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 14:15:40 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/51f92940/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