aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/NonNull.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2013-07-22 23:23:46 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2013-07-22 23:23:46 +0200
commit45697b50816df79475a8bb69dc89ff68747fbfe6 (patch)
tree25cb023eec1f74baf5063cc5a58a5351ee43d6f0 /src/core/lombok/NonNull.java
parent4c03e3d220900431085897878d4888bf530b31ec (diff)
parentdeed98be16e5099af52d951fc611f86a82a42858 (diff)
downloadlombok-45697b50816df79475a8bb69dc89ff68747fbfe6.tar.gz
lombok-45697b50816df79475a8bb69dc89ff68747fbfe6.tar.bz2
lombok-45697b50816df79475a8bb69dc89ff68747fbfe6.zip
Merge branch 'master' into jdk8. Also added some major fixes whilst merging.
Conflicts: src/core/lombok/javac/handlers/JavacHandlerUtil.java src/utils/lombok/javac/CommentCatcher.java src/utils/lombok/javac/Javac.java
Diffstat (limited to 'src/core/lombok/NonNull.java')
-rw-r--r--src/core/lombok/NonNull.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/core/lombok/NonNull.java b/src/core/lombok/NonNull.java
index 5f5d8ed2..96813170 100644
--- a/src/core/lombok/NonNull.java
+++ b/src/core/lombok/NonNull.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 The Project Lombok Authors.
+ * Copyright (C) 2009-2013 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -28,12 +28,14 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * Lombok is smart enough to translate any annotation named {@code @NonNull} in any casing and
- * with any package name to the return type of generated getters and the parameter of generated setters and constructors,
- * as well as generate the appropriate null checks in the setter and constructor.
- *
- * You can use this annotation for the purpose, though you can also use JSR305's annotation, findbugs's, pmd's, or IDEA's, or just
- * about anyone elses. As long as it is named {@code @NonNull}.
+ * If put on a parameter, lombok will insert a null-check at the start of the method / constructor's body, throwing a
+ * {@code NullPointerException} with the parameter's name as message. If put on a field, any generated method assigning
+ * a value to this field will also produce these nullchecks.
+ * <p>
+ * Note that any annotation named {@code NonNull} with any casing and any package will result in nullchecks produced for
+ * generated methods (and the annotation will be copied to the getter return type and any parameters of generated methods),
+ * but <em>only</em> this annotation, if present on a parameter, will result in a null check inserted into your otherwise
+ * handwritten method.
*
* WARNING: If the java community ever does decide on supporting a single {@code @NonNull} annotation (for example via JSR305), then
* this annotation will <strong>be deleted</strong> from the lombok package. If the need to update an import statement scares