From 51f929403509229eac6c9bc92400e4573cc1768a Mon Sep 17 00:00:00 2001 From: John Wagenleitner Date: Sat, 5 Aug 2017 11:05:17 -0700 Subject: [PATCH] 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. --- src/main/groovy/lang/Newify.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/groovy/lang/Newify.java b/src/main/groovy/lang/Newify.java index 66edcde9c0..5bf7fdfaf5 100644 --- a/src/main/groovy/lang/Newify.java +++ b/src/main/groovy/lang/Newify.java @@ -28,7 +28,7 @@ /** * 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. *

* It allows you to write code snippets like this ("Python-style"): *

@@ -100,7 +100,7 @@
 @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