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 2022/11/22 05:27:58 UTC
[groovy] branch GROOVY_3_0_X updated: GROOVY-10442: @Immutable GroovyDoc examples use @Canonical instead
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch GROOVY_3_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/GROOVY_3_0_X by this push:
new baf81747e2 GROOVY-10442: @Immutable GroovyDoc examples use @Canonical instead
baf81747e2 is described below
commit baf81747e2ad31c3ea77bb092db15a6d7ccff8b3
Author: Paul King <pa...@asert.com.au>
AuthorDate: Tue Nov 22 15:27:50 2022 +1000
GROOVY-10442: @Immutable GroovyDoc examples use @Canonical instead
---
src/main/groovy/groovy/transform/Immutable.groovy | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/main/groovy/groovy/transform/Immutable.groovy b/src/main/groovy/groovy/transform/Immutable.groovy
index c59142929b..aba812f1f3 100644
--- a/src/main/groovy/groovy/transform/Immutable.groovy
+++ b/src/main/groovy/groovy/transform/Immutable.groovy
@@ -136,7 +136,7 @@ import java.lang.annotation.Target
* <pre class="groovyTestCase">
* import groovy.transform.*
*
- * @Canonical
+ * @Immutable(defaults=true, noArg=false)
* class Building {
* String name
* int floors
@@ -153,7 +153,7 @@ import java.lang.annotation.Target
* // arguments are not assigned.
* def theOffice = new Building('Wernham Hogg Paper Company')
* assert theOffice.floors == 0
- * theOffice.officeSpace = true
+ * assert theOffice.officeSpace == false
*
* def anotherOfficeSpace = new Building(name: 'Initech office', floors: 1, officeSpace: true)
*
@@ -165,7 +165,7 @@ import java.lang.annotation.Target
* assert offices.size() == 2
* assert offices.name.join(',') == 'Initech office,Wernham Hogg Paper Company'
*
- * @Canonical
+ * @Immutable
* @ToString(excludes='age') // Customize one of the transformations.
* class Person {
* String name