aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource/after-delombok
diff options
context:
space:
mode:
authorReinier Zwitserloot <r.zwitserloot@projectlombok.org>2019-05-06 22:48:11 +0200
committerReinier Zwitserloot <r.zwitserloot@projectlombok.org>2019-05-06 22:48:11 +0200
commite69a991fcb141fb24de8afb433c753d35821b1c3 (patch)
treee396b9e38e86fa7a08568d8c59d75b29803dbd0e /test/transform/resource/after-delombok
parentd41e804fe73faed5f8b90f4b472728bc3a0c85b7 (diff)
downloadlombok-e69a991fcb141fb24de8afb433c753d35821b1c3.tar.gz
lombok-e69a991fcb141fb24de8afb433c753d35821b1c3.tar.bz2
lombok-e69a991fcb141fb24de8afb433c753d35821b1c3.zip
[fixes #2120] ecj was not generating explicit nullchecks for builder-setters.
Diffstat (limited to 'test/transform/resource/after-delombok')
-rw-r--r--test/transform/resource/after-delombok/BuilderWithNonNull.java40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/transform/resource/after-delombok/BuilderWithNonNull.java b/test/transform/resource/after-delombok/BuilderWithNonNull.java
new file mode 100644
index 00000000..bee7d415
--- /dev/null
+++ b/test/transform/resource/after-delombok/BuilderWithNonNull.java
@@ -0,0 +1,40 @@
+class BuilderWithNonNull {
+ @lombok.NonNull
+ private final String id;
+ @java.lang.SuppressWarnings("all")
+ BuilderWithNonNull(@lombok.NonNull final String id) {
+ if (id == null) {
+ throw new java.lang.NullPointerException("id is marked non-null but is null");
+ }
+ this.id = id;
+ }
+ @java.lang.SuppressWarnings("all")
+ public static class BuilderWithNonNullBuilder {
+ @java.lang.SuppressWarnings("all")
+ private String id;
+ @java.lang.SuppressWarnings("all")
+ BuilderWithNonNullBuilder() {
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderWithNonNullBuilder id(@lombok.NonNull final String id) {
+ if (id == null) {
+ throw new java.lang.NullPointerException("id is marked non-null but is null");
+ }
+ this.id = id;
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderWithNonNull build() {
+ return new BuilderWithNonNull(id);
+ }
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public java.lang.String toString() {
+ return "BuilderWithNonNull.BuilderWithNonNullBuilder(id=" + this.id + ")";
+ }
+ }
+ @java.lang.SuppressWarnings("all")
+ public static BuilderWithNonNullBuilder builder() {
+ return new BuilderWithNonNullBuilder();
+ }
+} \ No newline at end of file