Skip to content

Commit 3590d77

Browse files
committed
GROOVY-8088: For @MapConstructor and @TupleConstructor we should provide a default undefined value for better Java compatibility (closes groovy#498)
1 parent cf8686a commit 3590d77

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/groovy/transform/MapConstructor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@
114114
/**
115115
* A Closure containing statements which will be prepended to the generated constructor. The first statement within the Closure may be "super(someArgs)" in which case the no-arg super constructor won't be called.
116116
*/
117-
Class pre();
117+
Class pre() default Undefined.CLASS.class;
118118

119119
/**
120120
* A Closure containing statements which will be appended to the end of the generated constructor. Useful for validation steps or tweaking the populated fields/properties.
121121
*/
122-
Class post();
122+
Class post() default Undefined.CLASS.class;
123123

124124
/**
125125
* Whether to include all fields and/or properties within the constructor, including those with names that are considered internal.

src/main/groovy/transform/TupleConstructor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,12 +267,12 @@
267267
*
268268
* @since 2.5.0
269269
*/
270-
Class pre();
270+
Class pre() default Undefined.CLASS.class;
271271

272272
/**
273273
* A Closure containing statements which will be appended to the end of the generated constructor. Useful for validation steps or tweaking the populated fields/properties.
274274
*
275275
* @since 2.5.0
276276
*/
277-
Class post();
277+
Class post() default Undefined.CLASS.class;
278278
}

0 commit comments

Comments
 (0)