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 2016/03/05 13:58:51 UTC

[2/2] groovy git commit: ToString: remove javadoc example with date from automated testing

ToString: remove javadoc example with date from automated testing


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/ff393ba9
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/ff393ba9
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/ff393ba9

Branch: refs/heads/GROOVY_2_4_X
Commit: ff393ba95ef908777b28958613b175d9df88c569
Parents: 1e0aeb3
Author: pascalschumacher <pa...@gmx.net>
Authored: Sat Mar 5 13:41:25 2016 +0100
Committer: pascalschumacher <pa...@gmx.net>
Committed: Sat Mar 5 13:55:58 2016 +0100

----------------------------------------------------------------------
 src/main/groovy/transform/ToString.java | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/ff393ba9/src/main/groovy/transform/ToString.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/transform/ToString.java b/src/main/groovy/transform/ToString.java
index e83649e..acd594e 100644
--- a/src/main/groovy/transform/ToString.java
+++ b/src/main/groovy/transform/ToString.java
@@ -31,8 +31,8 @@ import java.lang.annotation.Target;
  * AST transformation which adds the necessary toString() method.
  * <p>
  * It allows you to write classes in this shortened form:
- * <pre class="groovyTestCase">
- * {@code @groovy.transform.ToString}
+ * <pre>
+ * {@code @ToString}
  * class Customer {
  *     String first, last
  *     int age
@@ -40,8 +40,11 @@ import java.lang.annotation.Target;
  *     Collection favItems
  *     private answer = 42
  * }
- * String customerAsString = new Customer(first:'Tom', last:'Jones', age:21, favItems:['Books', 'Games']).toString()
- * assert customerAsString == 'Customer(Tom, Jones, 21, Wed Jul 14 23:57:14 EST 2010, [Books, Games])'
+ * println new Customer(first:'Tom', last:'Jones', age:21, favItems:['Books', 'Games'])
+ * </pre>
+ * Which will have this output:
+ * <pre>
+ * Customer(Tom, Jones, 21, Wed Jul 14 23:57:14 EST 2010, [Books, Games])
  * </pre>
  * There are numerous options to customize the format of the generated output.
  * E.g. if you change the first annotation to: