diff options
author | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2020-01-31 06:33:33 +0100 |
---|---|---|
committer | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2020-01-31 06:33:33 +0100 |
commit | c42bfbae39990b365a5f05eb23895da6203023bc (patch) | |
tree | 6bbebbff773571debc5709072e735f2f42469d46 /test/transform/resource/before | |
parent | d31182c4383a5ccc499862d2a8035d49e5202319 (diff) | |
download | lombok-c42bfbae39990b365a5f05eb23895da6203023bc.tar.gz lombok-c42bfbae39990b365a5f05eb23895da6203023bc.tar.bz2 lombok-c42bfbae39990b365a5f05eb23895da6203023bc.zip |
[issue #2221] simplified configuration for `@Singular`-generated plural form nullchecks.
Diffstat (limited to 'test/transform/resource/before')
3 files changed, 7 insertions, 10 deletions
diff --git a/test/transform/resource/before/BuilderSingularMapsWithSetterPrefix.java b/test/transform/resource/before/BuilderSingularMapsWithSetterPrefix.java index 89beb401..87ad7b9f 100644 --- a/test/transform/resource/before/BuilderSingularMapsWithSetterPrefix.java +++ b/test/transform/resource/before/BuilderSingularMapsWithSetterPrefix.java @@ -1,7 +1,6 @@ //FORMAT: javaLangAsFQN = skip //FORMAT: generated = skip //FORMAT: finalParams = skip -//CONF: lombok.singular.nullCollections = ignore import java.util.Map; import java.util.SortedMap; @@ -11,6 +10,6 @@ import lombok.Singular; class BuilderSingularMapsWithSetterPrefix<K, V> { @Singular private Map<K, V> women; @Singular private SortedMap<K, ? extends Number> men; - @SuppressWarnings("all") @Singular("rawMap") private Map rawMap; + @SuppressWarnings("all") @Singular(value = "rawMap", ignoreNullCollections = true) private Map rawMap; @Singular("stringMap") private Map<String, V> stringMap; } diff --git a/test/transform/resource/before/BuilderSingularNullBehavior1.java b/test/transform/resource/before/BuilderSingularNullBehavior1.java index 019b6473..bcf473a4 100644 --- a/test/transform/resource/before/BuilderSingularNullBehavior1.java +++ b/test/transform/resource/before/BuilderSingularNullBehavior1.java @@ -1,13 +1,12 @@ +//CONF: lombok.addNullAnnotations = checkerframework +//CONF: lombok.nonNull.exceptionType = assertion import java.util.List; import java.util.Collection; import lombok.Singular; -import lombok.Singular.NullCollectionBehavior; @lombok.Builder class BuilderSingularNullBehavior1 { @Singular private List<String> names; - @Singular(nullBehavior = Singular.NullCollectionBehavior.JDK) private List<String> locations; - @Singular(nullBehavior = NullCollectionBehavior.GUAVA) private List<String> whatevers; - @Singular(nullBehavior = lombok.Singular.NullCollectionBehavior.IGNORE) private List<String> doohickeys; + @Singular(ignoreNullCollections = true) private List<String> locations; } diff --git a/test/transform/resource/before/BuilderSingularNullBehavior2.java b/test/transform/resource/before/BuilderSingularNullBehavior2.java index 720cf5a8..7d1d0e57 100644 --- a/test/transform/resource/before/BuilderSingularNullBehavior2.java +++ b/test/transform/resource/before/BuilderSingularNullBehavior2.java @@ -1,11 +1,10 @@ -//CONF: lombok.addNullAnnotations = checkerframework +//CONF: lombok.addNullAnnotations = spring +//CONF: lombok.nonNull.exceptionType = JDK import java.util.List; import lombok.Singular; -import lombok.Singular.NullCollectionBehavior; @lombok.Builder class BuilderSingularNullBehavior2 { - @Singular(nullBehavior = Singular.NullCollectionBehavior.JDK) private List<String> locations; - @Singular(nullBehavior = lombok.Singular.NullCollectionBehavior.IGNORE) private List<String> doohickeys; + @Singular private List<String> locations; } |