aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@tipit.to>2009-08-28 00:16:58 +0200
committerReinier Zwitserloot <reinier@tipit.to>2009-08-28 00:16:58 +0200
commite92fd5abac039cfc1f47a030dc0f084e9f018b8b (patch)
treec4cb63fea756f26cacaf79065048baa75250ff58
parent0236721d8d3cde431d0a40995a61e4fd3fe14be1 (diff)
downloadlombok-e92fd5abac039cfc1f47a030dc0f084e9f018b8b.tar.gz
lombok-e92fd5abac039cfc1f47a030dc0f084e9f018b8b.tar.bz2
lombok-e92fd5abac039cfc1f47a030dc0f084e9f018b8b.zip
Fixes issue #35: ToString now defaults to includeFieldNames=true.
-rw-r--r--doc/changelog.markdown1
-rw-r--r--src/lombok/ToString.java9
2 files changed, 6 insertions, 4 deletions
diff --git a/doc/changelog.markdown b/doc/changelog.markdown
index fe39a509..58d6957a 100644
--- a/doc/changelog.markdown
+++ b/doc/changelog.markdown
@@ -5,6 +5,7 @@ Lombok Changelog
* All generated methods now make their parameters (if they have any) final. This should help avoid problems with the 'make all parameters final' save action in eclipse. [Issue #40](http://code.google.com/p/projectlombok/issues/detail?id=40)
* Okay, this time _really_ added support for @NonNull and @NotNull annotations. It was reported for v0.8.3 but it wasn't actually in that release. @Nullable annotations are now also copied over to the getter's return type and the setter and constructor's parameters (but, obviously, no check is added).
+* @ToString (and hence, @Data) now default to includeFieldNames=true. [Issue #35](http://code.google.com/p/projectlombok/issues/detail?id=35)
### v0.8.3
diff --git a/src/lombok/ToString.java b/src/lombok/ToString.java
index 5bcba540..10c61807 100644
--- a/src/lombok/ToString.java
+++ b/src/lombok/ToString.java
@@ -42,8 +42,9 @@ import java.lang.annotation.Target;
* {@link java.lang.StackOverflowError}. However, the implementations for java's own {@link java.util.ArrayList} suffer
* from the same flaw.
* <p>
- * The <code>toString</code> method that is generated will print the class name as well as each field. You can optionally
- * also print the names of each field, by setting the <code>includeFieldNames</code> flag to <em>true</em>.
+ * The <code>toString</code> method that is generated will print the class name as well as each field (both the name
+ * and the value). You can optionally choose to suppress the printing of the field name, by setting the
+ * <code>includeFieldNames</code> flag to <em>false</em>.
* <p>
* You can also choose to include the result of <code>toString</code> in your class's superclass by setting the
* <code>callSuper</code> to <em>true</em>.
@@ -53,9 +54,9 @@ import java.lang.annotation.Target;
public @interface ToString {
/**
* Include the name of each field when printing it.
- * <strong>default: false</strong>
+ * <strong>default: true</strong>
*/
- boolean includeFieldNames() default false;
+ boolean includeFieldNames() default true;
/**
* Any fields listed here will not be printed in the generated <code>toString</code> implementation.