aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource
diff options
context:
space:
mode:
authorJan Rieke <rieke@subshell.com>2018-08-16 17:58:05 +0200
committerJan Rieke <rieke@subshell.com>2018-08-16 17:58:05 +0200
commit31aef5219d6e6a39afe5dfa5d888bddd6e942e25 (patch)
tree911c13bbaf052ae0ac08c0c386f27fe69d180b3e /test/transform/resource
parent46837d6d8be26cea9d0b8cf2959866ac308cbf2d (diff)
downloadlombok-31aef5219d6e6a39afe5dfa5d888bddd6e942e25.tar.gz
lombok-31aef5219d6e6a39afe5dfa5d888bddd6e942e25.tar.bz2
lombok-31aef5219d6e6a39afe5dfa5d888bddd6e942e25.zip
only assign value once so that final fields work (javac)
Diffstat (limited to 'test/transform/resource')
-rw-r--r--test/transform/resource/after-delombok/SuperBuilderWithNonNull.java6
-rw-r--r--test/transform/resource/before/SuperBuilderWithNonNull.java2
2 files changed, 4 insertions, 4 deletions
diff --git a/test/transform/resource/after-delombok/SuperBuilderWithNonNull.java b/test/transform/resource/after-delombok/SuperBuilderWithNonNull.java
index 6fea9d17..5eba938f 100644
--- a/test/transform/resource/after-delombok/SuperBuilderWithNonNull.java
+++ b/test/transform/resource/after-delombok/SuperBuilderWithNonNull.java
@@ -2,7 +2,7 @@ import java.util.List;
public class SuperBuilderWithNonNull {
public static class Parent {
@lombok.NonNull
- String nonNullParentField;
+ final String nonNullParentField;
@java.lang.SuppressWarnings("all")
private static String $default$nonNullParentField() {
return "default";
@@ -47,8 +47,8 @@ public class SuperBuilderWithNonNull {
}
@java.lang.SuppressWarnings("all")
protected Parent(final ParentBuilder<?, ?> b) {
- this.nonNullParentField = b.nonNullParentField;
- if (!b.nonNullParentField$set) this.nonNullParentField = Parent.$default$nonNullParentField();
+ if (b.nonNullParentField$set) this.nonNullParentField = b.nonNullParentField;
+ else this.nonNullParentField = Parent.$default$nonNullParentField();
if (nonNullParentField == null) {
throw new java.lang.NullPointerException("nonNullParentField is marked @NonNull but is null");
}
diff --git a/test/transform/resource/before/SuperBuilderWithNonNull.java b/test/transform/resource/before/SuperBuilderWithNonNull.java
index 21f67a47..34668bbc 100644
--- a/test/transform/resource/before/SuperBuilderWithNonNull.java
+++ b/test/transform/resource/before/SuperBuilderWithNonNull.java
@@ -5,7 +5,7 @@ public class SuperBuilderWithNonNull {
public static class Parent {
@lombok.NonNull
@lombok.Builder.Default
- String nonNullParentField = "default";
+ final String nonNullParentField = "default";
}
@lombok.experimental.SuperBuilder