From cb091204f4bfc7f9971fc296903f7bc2a163f085 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Tue, 1 Sep 2009 00:19:28 +0200 Subject: Fixed documentation, specifically: added eclipse help system fix to the changelog, and added some documentation on the special handling of @NonNull/@NotNull/@Nullable for Data and Getter/Setter on the website docs. --- doc/changelog.markdown | 3 ++- website/features/Data.html | 9 ++++++++- website/features/GetterSetter.html | 4 ++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/doc/changelog.markdown b/doc/changelog.markdown index 58d6957a..6ffc14cc 100644 --- a/doc/changelog.markdown +++ b/doc/changelog.markdown @@ -3,8 +3,9 @@ Lombok Changelog ### v0.8.4 +* Fixed the problem where eclipse's help system did not start up on lombokized eclipses. [Issue #26](http://code.google.com/p/projectlombok/issues/detail?id=26) * 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). +* 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). Any @NonNull annotated non-final fields that are not initialized are now also added to the generated constructor by @Data in order to ensure via an explicit null check that they contain a legal value. * @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/website/features/Data.html b/website/features/Data.html index 19eacdd8..9216d46e 100644 --- a/website/features/Data.html +++ b/website/features/Data.html @@ -22,7 +22,8 @@ together: In other words, @Data generates all the boilerplate that is normally associated with simple POJOs (Plain Old Java Objects) and beans: getters for all fields, setters for all non-final fields, and appropriate toString, equals and hashCode implementations that involve the fields of the class. In addition, @Data generates a constructor that - initialized all final fields. + initializes all final fields, as well as all non-final fields with no initializer that have been marked with @NonNull or @NotNull, + in order to ensure the field is never null.

@Data is like having implicit @ToString and @EqualsAndHashCode annotations on the class. However, the parameters of @ToString and @EqualsAndHashCode (such as callSuper, includeFieldNames and @@ -62,6 +63,12 @@

Small print

See the small print of @ToString, @EqualsAndHashCode and @Getter / @Setter. +

+ Any annotations named @NonNull or @NotNull (case insensitive) on a field are interpreted as: This field must not ever hold + null. Therefore, these annotations result in an explicit null check in the generated constructor for the provided field. Also, these + annotations (as well as any annotation named @Nullable) are copied to the constructor parameter, in both the true constructor and + any static constructor. The same principle applies to generated getters and setters (see the documentation for @Getter / @Setter) +

-- cgit