diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2018-10-15 21:12:45 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2018-10-15 21:16:03 +0200 |
commit | 94eadb5131b32b6cf599a3f5445524a08ba0569b (patch) | |
tree | 391e310ec42d25e9ee26bbff57290d492da23f51 /test/transform/resource/after-delombok/BuilderSingularToBuilderWithNull.java | |
parent | 06455de367932e93da707b9d91e1a347d0c072a6 (diff) | |
download | lombok-94eadb5131b32b6cf599a3f5445524a08ba0569b.tar.gz lombok-94eadb5131b32b6cf599a3f5445524a08ba0569b.tar.bz2 lombok-94eadb5131b32b6cf599a3f5445524a08ba0569b.zip |
[fixes #1324] toBuilder with @Singular marked collections that are null no longer throws NPE.
Diffstat (limited to 'test/transform/resource/after-delombok/BuilderSingularToBuilderWithNull.java')
-rw-r--r-- | test/transform/resource/after-delombok/BuilderSingularToBuilderWithNull.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/transform/resource/after-delombok/BuilderSingularToBuilderWithNull.java b/test/transform/resource/after-delombok/BuilderSingularToBuilderWithNull.java index b0563858..96ffd2dc 100644 --- a/test/transform/resource/after-delombok/BuilderSingularToBuilderWithNull.java +++ b/test/transform/resource/after-delombok/BuilderSingularToBuilderWithNull.java @@ -58,6 +58,8 @@ class BuilderSingularToBuilderWithNull { } @java.lang.SuppressWarnings("all") public BuilderSingularToBuilderWithNullBuilder toBuilder() { - return new BuilderSingularToBuilderWithNullBuilder().elems(this.elems == null ? java.util.Collections.<String>emptyList() : this.elems); + final BuilderSingularToBuilderWithNullBuilder builder = new BuilderSingularToBuilderWithNullBuilder(); + if (this.elems != null) builder.elems(this.elems); + return builder; } } |