diff options
author | Jan Rieke <rieke@subshell.com> | 2018-09-24 16:46:00 +0200 |
---|---|---|
committer | Jan Rieke <rieke@subshell.com> | 2018-09-24 16:46:00 +0200 |
commit | b5648976b6501bdf755814d8d8a096c33f6997ec (patch) | |
tree | aafe939cdc6fdda41719deb42f03c77934cb5209 /test/transform | |
parent | fd4c9d4bff6e75b30a3ee247edafaabc6888a691 (diff) | |
parent | aee4e76d864e01b5d453409e703ad54852fa57bb (diff) | |
download | lombok-b5648976b6501bdf755814d8d8a096c33f6997ec.tar.gz lombok-b5648976b6501bdf755814d8d8a096c33f6997ec.tar.bz2 lombok-b5648976b6501bdf755814d8d8a096c33f6997ec.zip |
Merge remote-tracking branch 'upstream/master' into superToBuilder
Diffstat (limited to 'test/transform')
40 files changed, 919 insertions, 76 deletions
diff --git a/test/transform/resource/after-delombok/BuilderSingularAnnotatedTypes.java b/test/transform/resource/after-delombok/BuilderSingularAnnotatedTypes.java new file mode 100644 index 00000000..93825659 --- /dev/null +++ b/test/transform/resource/after-delombok/BuilderSingularAnnotatedTypes.java @@ -0,0 +1,124 @@ +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +import java.util.Set; +import java.util.Map; +import lombok.NonNull; +@Target(ElementType.TYPE_USE) +@interface MyAnnotation { +} +class BuilderSingularAnnotatedTypes { + private Set<@MyAnnotation @NonNull String> foos; + private Map<@MyAnnotation @NonNull String, @MyAnnotation @NonNull Integer> bars; + @java.lang.SuppressWarnings("all") + BuilderSingularAnnotatedTypes(final Set<@MyAnnotation @NonNull String> foos, final Map<@MyAnnotation @NonNull String, @MyAnnotation @NonNull Integer> bars) { + this.foos = foos; + this.bars = bars; + } + @java.lang.SuppressWarnings("all") + public static class BuilderSingularAnnotatedTypesBuilder { + @java.lang.SuppressWarnings("all") + private java.util.ArrayList<@MyAnnotation @NonNull String> foos; + @java.lang.SuppressWarnings("all") + private java.util.ArrayList<@MyAnnotation @NonNull String> bars$key; + @java.lang.SuppressWarnings("all") + private java.util.ArrayList<@MyAnnotation @NonNull Integer> bars$value; + @java.lang.SuppressWarnings("all") + BuilderSingularAnnotatedTypesBuilder() { + } + @java.lang.SuppressWarnings("all") + public BuilderSingularAnnotatedTypesBuilder foo(@MyAnnotation @NonNull final String foo) { + if (foo == null) { + throw new java.lang.NullPointerException("foo is marked @NonNull but is null"); + } + if (this.foos == null) this.foos = new java.util.ArrayList<@MyAnnotation @NonNull String>(); + this.foos.add(foo); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularAnnotatedTypesBuilder foos(final java.util.Collection<? extends @MyAnnotation @NonNull String> foos) { + if (this.foos == null) this.foos = new java.util.ArrayList<@MyAnnotation @NonNull String>(); + this.foos.addAll(foos); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularAnnotatedTypesBuilder clearFoos() { + if (this.foos != null) this.foos.clear(); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularAnnotatedTypesBuilder bar(@MyAnnotation @NonNull final String barKey, @MyAnnotation @NonNull final Integer barValue) { + if (barKey == null) { + throw new java.lang.NullPointerException("barKey is marked @NonNull but is null"); + } + if (barValue == null) { + throw new java.lang.NullPointerException("barValue is marked @NonNull but is null"); + } + if (this.bars$key == null) { + this.bars$key = new java.util.ArrayList<@MyAnnotation @NonNull String>(); + this.bars$value = new java.util.ArrayList<@MyAnnotation @NonNull Integer>(); + } + this.bars$key.add(barKey); + this.bars$value.add(barValue); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularAnnotatedTypesBuilder bars(final java.util.Map<? extends @MyAnnotation @NonNull String, ? extends @MyAnnotation @NonNull Integer> bars) { + if (this.bars$key == null) { + this.bars$key = new java.util.ArrayList<@MyAnnotation @NonNull String>(); + this.bars$value = new java.util.ArrayList<@MyAnnotation @NonNull Integer>(); + } + for (final java.util.Map.Entry<? extends @MyAnnotation @NonNull String, ? extends @MyAnnotation @NonNull Integer> $lombokEntry : bars.entrySet()) { + this.bars$key.add($lombokEntry.getKey()); + this.bars$value.add($lombokEntry.getValue()); + } + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularAnnotatedTypesBuilder clearBars() { + if (this.bars$key != null) { + this.bars$key.clear(); + this.bars$value.clear(); + } + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularAnnotatedTypes build() { + java.util.Set<@MyAnnotation @NonNull String> foos; + switch (this.foos == null ? 0 : this.foos.size()) { + case 0: + foos = java.util.Collections.emptySet(); + break; + case 1: + foos = java.util.Collections.singleton(this.foos.get(0)); + break; + default: + foos = new java.util.LinkedHashSet<@MyAnnotation @NonNull String>(this.foos.size() < 1073741824 ? 1 + this.foos.size() + (this.foos.size() - 3) / 3 : java.lang.Integer.MAX_VALUE); + foos.addAll(this.foos); + foos = java.util.Collections.unmodifiableSet(foos); + } + java.util.Map<@MyAnnotation @NonNull String, @MyAnnotation @NonNull Integer> bars; + switch (this.bars$key == null ? 0 : this.bars$key.size()) { + case 0: + bars = java.util.Collections.emptyMap(); + break; + case 1: + bars = java.util.Collections.singletonMap(this.bars$key.get(0), this.bars$value.get(0)); + break; + default: + bars = new java.util.LinkedHashMap<@MyAnnotation @NonNull String, @MyAnnotation @NonNull Integer>(this.bars$key.size() < 1073741824 ? 1 + this.bars$key.size() + (this.bars$key.size() - 3) / 3 : java.lang.Integer.MAX_VALUE); + for (int $i = 0; $i < this.bars$key.size(); $i++) bars.put(this.bars$key.get($i), (@MyAnnotation @NonNull Integer) this.bars$value.get($i)); + bars = java.util.Collections.unmodifiableMap(bars); + } + return new BuilderSingularAnnotatedTypes(foos, bars); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "BuilderSingularAnnotatedTypes.BuilderSingularAnnotatedTypesBuilder(foos=" + this.foos + ", bars$key=" + this.bars$key + ", bars$value=" + this.bars$value + ")"; + } + } + @java.lang.SuppressWarnings("all") + public static BuilderSingularAnnotatedTypesBuilder builder() { + return new BuilderSingularAnnotatedTypesBuilder(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/BuilderTypeAnnos.java b/test/transform/resource/after-delombok/BuilderTypeAnnos.java new file mode 100644 index 00000000..8a31762a --- /dev/null +++ b/test/transform/resource/after-delombok/BuilderTypeAnnos.java @@ -0,0 +1,45 @@ +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +import java.util.List; +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) +@interface TA { +} +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) +@interface TB { +} +class BuilderTypeAnnos { + @TA + @TB + private List<String> foo; + @java.lang.SuppressWarnings("all") + BuilderTypeAnnos(@TA final List<String> foo) { + this.foo = foo; + } + @java.lang.SuppressWarnings("all") + public static class BuilderTypeAnnosBuilder { + @java.lang.SuppressWarnings("all") + private List<String> foo; + @java.lang.SuppressWarnings("all") + BuilderTypeAnnosBuilder() { + } + @java.lang.SuppressWarnings("all") + public BuilderTypeAnnosBuilder foo(@TA final List<String> foo) { + this.foo = foo; + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderTypeAnnos build() { + return new BuilderTypeAnnos(foo); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "BuilderTypeAnnos.BuilderTypeAnnosBuilder(foo=" + this.foo + ")"; + } + } + @java.lang.SuppressWarnings("all") + public static BuilderTypeAnnosBuilder builder() { + return new BuilderTypeAnnosBuilder(); + } +} + diff --git a/test/transform/resource/after-delombok/ConstructorsTypeAnnos.java b/test/transform/resource/after-delombok/ConstructorsTypeAnnos.java new file mode 100644 index 00000000..2d59681c --- /dev/null +++ b/test/transform/resource/after-delombok/ConstructorsTypeAnnos.java @@ -0,0 +1,18 @@ +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +import java.util.List; +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) +@interface TA { +} +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) +@interface TB { +} +class ConstructorsTypeAnnos { + @TA + @TB + List<String> foo; + @java.lang.SuppressWarnings("all") + public ConstructorsTypeAnnos(@TA final List<String> foo) { + this.foo = foo; + } +} diff --git a/test/transform/resource/after-delombok/GetterTypeAnnos.java b/test/transform/resource/after-delombok/GetterTypeAnnos.java new file mode 100644 index 00000000..4a22c822 --- /dev/null +++ b/test/transform/resource/after-delombok/GetterTypeAnnos.java @@ -0,0 +1,19 @@ +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +import java.util.List; +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) +@interface TA { +} +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) +@interface TB { +} +class GetterTypeAnnos { + @TA + @TB + List<String> foo; + @TA + @java.lang.SuppressWarnings("all") + public List<String> getFoo() { + return this.foo; + } +} diff --git a/test/transform/resource/after-delombok/SetterTypeAnnos.java b/test/transform/resource/after-delombok/SetterTypeAnnos.java new file mode 100644 index 00000000..77ddf9ce --- /dev/null +++ b/test/transform/resource/after-delombok/SetterTypeAnnos.java @@ -0,0 +1,18 @@ +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +import java.util.List; +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) +@interface TA { +} +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) +@interface TB { +} +class SetterTypeAnnos { + @TA + @TB + List<String> foo; + @java.lang.SuppressWarnings("all") + public void setFoo(@TA final List<String> foo) { + this.foo = foo; + } +} diff --git a/test/transform/resource/after-delombok/SuperBuilderSingularAnnotatedTypes.java b/test/transform/resource/after-delombok/SuperBuilderSingularAnnotatedTypes.java new file mode 100644 index 00000000..1baf81aa --- /dev/null +++ b/test/transform/resource/after-delombok/SuperBuilderSingularAnnotatedTypes.java @@ -0,0 +1,137 @@ +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +import java.util.Set; +import java.util.Map; +import lombok.NonNull; +@Target(ElementType.TYPE_USE) +@interface MyAnnotation { +} +class SuperBuilderSingularAnnotatedTypes { + private Set<@MyAnnotation @NonNull String> foos; + private Map<@MyAnnotation @NonNull String, @MyAnnotation @NonNull Integer> bars; + @java.lang.SuppressWarnings("all") + public static abstract class SuperBuilderSingularAnnotatedTypesBuilder<C extends SuperBuilderSingularAnnotatedTypes, B extends SuperBuilderSingularAnnotatedTypesBuilder<C, B>> { + @java.lang.SuppressWarnings("all") + private java.util.ArrayList<@MyAnnotation @NonNull String> foos; + @java.lang.SuppressWarnings("all") + private java.util.ArrayList<@MyAnnotation @NonNull String> bars$key; + @java.lang.SuppressWarnings("all") + private java.util.ArrayList<@MyAnnotation @NonNull Integer> bars$value; + @java.lang.SuppressWarnings("all") + protected abstract B self(); + @java.lang.SuppressWarnings("all") + public abstract C build(); + @java.lang.SuppressWarnings("all") + public B foo(@MyAnnotation @NonNull final String foo) { + if (foo == null) { + throw new java.lang.NullPointerException("foo is marked @NonNull but is null"); + } + if (this.foos == null) this.foos = new java.util.ArrayList<@MyAnnotation @NonNull String>(); + this.foos.add(foo); + return self(); + } + @java.lang.SuppressWarnings("all") + public B foos(final java.util.Collection<? extends @MyAnnotation @NonNull String> foos) { + if (this.foos == null) this.foos = new java.util.ArrayList<@MyAnnotation @NonNull String>(); + this.foos.addAll(foos); + return self(); + } + @java.lang.SuppressWarnings("all") + public B clearFoos() { + if (this.foos != null) this.foos.clear(); + return self(); + } + @java.lang.SuppressWarnings("all") + public B bar(@MyAnnotation @NonNull final String barKey, @MyAnnotation @NonNull final Integer barValue) { + if (barKey == null) { + throw new java.lang.NullPointerException("barKey is marked @NonNull but is null"); + } + if (barValue == null) { + throw new java.lang.NullPointerException("barValue is marked @NonNull but is null"); + } + if (this.bars$key == null) { + this.bars$key = new java.util.ArrayList<@MyAnnotation @NonNull String>(); + this.bars$value = new java.util.ArrayList<@MyAnnotation @NonNull Integer>(); + } + this.bars$key.add(barKey); + this.bars$value.add(barValue); + return self(); + } + @java.lang.SuppressWarnings("all") + public B bars(final java.util.Map<? extends @MyAnnotation @NonNull String, ? extends @MyAnnotation @NonNull Integer> bars) { + if (this.bars$key == null) { + this.bars$key = new java.util.ArrayList<@MyAnnotation @NonNull String>(); + this.bars$value = new java.util.ArrayList<@MyAnnotation @NonNull Integer>(); + } + for (final java.util.Map.Entry<? extends @MyAnnotation @NonNull String, ? extends @MyAnnotation @NonNull Integer> $lombokEntry : bars.entrySet()) { + this.bars$key.add($lombokEntry.getKey()); + this.bars$value.add($lombokEntry.getValue()); + } + return self(); + } + @java.lang.SuppressWarnings("all") + public B clearBars() { + if (this.bars$key != null) { + this.bars$key.clear(); + this.bars$value.clear(); + } + return self(); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "SuperBuilderSingularAnnotatedTypes.SuperBuilderSingularAnnotatedTypesBuilder(foos=" + this.foos + ", bars$key=" + this.bars$key + ", bars$value=" + this.bars$value + ")"; + } + } + @java.lang.SuppressWarnings("all") + private static final class SuperBuilderSingularAnnotatedTypesBuilderImpl extends SuperBuilderSingularAnnotatedTypesBuilder<SuperBuilderSingularAnnotatedTypes, SuperBuilderSingularAnnotatedTypesBuilderImpl> { + @java.lang.SuppressWarnings("all") + private SuperBuilderSingularAnnotatedTypesBuilderImpl() { + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + protected SuperBuilderSingularAnnotatedTypesBuilderImpl self() { + return this; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public SuperBuilderSingularAnnotatedTypes build() { + return new SuperBuilderSingularAnnotatedTypes(this); + } + } + @java.lang.SuppressWarnings("all") + protected SuperBuilderSingularAnnotatedTypes(final SuperBuilderSingularAnnotatedTypesBuilder<?, ?> b) { + java.util.Set<@MyAnnotation @NonNull String> foos; + switch (b.foos == null ? 0 : b.foos.size()) { + case 0: + foos = java.util.Collections.emptySet(); + break; + case 1: + foos = java.util.Collections.singleton(b.foos.get(0)); + break; + default: + foos = new java.util.LinkedHashSet<@MyAnnotation @NonNull String>(b.foos.size() < 1073741824 ? 1 + b.foos.size() + (b.foos.size() - 3) / 3 : java.lang.Integer.MAX_VALUE); + foos.addAll(b.foos); + foos = java.util.Collections.unmodifiableSet(foos); + } + this.foos = foos; + java.util.Map<@MyAnnotation @NonNull String, @MyAnnotation @NonNull Integer> bars; + switch (b.bars$key == null ? 0 : b.bars$key.size()) { + case 0: + bars = java.util.Collections.emptyMap(); + break; + case 1: + bars = java.util.Collections.singletonMap(b.bars$key.get(0), b.bars$value.get(0)); + break; + default: + bars = new java.util.LinkedHashMap<@MyAnnotation @NonNull String, @MyAnnotation @NonNull Integer>(b.bars$key.size() < 1073741824 ? 1 + b.bars$key.size() + (b.bars$key.size() - 3) / 3 : java.lang.Integer.MAX_VALUE); + for (int $i = 0; $i < b.bars$key.size(); $i++) bars.put(b.bars$key.get($i), (@MyAnnotation @NonNull Integer) b.bars$value.get($i)); + bars = java.util.Collections.unmodifiableMap(bars); + } + this.bars = bars; + } + @java.lang.SuppressWarnings("all") + public static SuperBuilderSingularAnnotatedTypesBuilder<?, ?> builder() { + return new SuperBuilderSingularAnnotatedTypesBuilderImpl(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/SuperBuilderWithNonNull.java b/test/transform/resource/after-delombok/SuperBuilderWithNonNull.java index 5eba938f..cac5482b 100644 --- a/test/transform/resource/after-delombok/SuperBuilderWithNonNull.java +++ b/test/transform/resource/after-delombok/SuperBuilderWithNonNull.java @@ -18,7 +18,10 @@ public class SuperBuilderWithNonNull { @java.lang.SuppressWarnings("all")
public abstract C build();
@java.lang.SuppressWarnings("all")
- public B nonNullParentField(final String nonNullParentField) {
+ public B nonNullParentField(@lombok.NonNull final String nonNullParentField) {
+ if (nonNullParentField == null) {
+ throw new java.lang.NullPointerException("nonNullParentField is marked @NonNull but is null");
+ }
this.nonNullParentField = nonNullParentField;
nonNullParentField$set = true;
return self();
@@ -72,7 +75,10 @@ public class SuperBuilderWithNonNull { @java.lang.SuppressWarnings("all")
public abstract C build();
@java.lang.SuppressWarnings("all")
- public B nonNullChildField(final String nonNullChildField) {
+ public B nonNullChildField(@lombok.NonNull final String nonNullChildField) {
+ if (nonNullChildField == null) {
+ throw new java.lang.NullPointerException("nonNullChildField is marked @NonNull but is null");
+ }
this.nonNullChildField = nonNullChildField;
return self();
}
diff --git a/test/transform/resource/after-delombok/WitherTypeAnnos.java b/test/transform/resource/after-delombok/WitherTypeAnnos.java new file mode 100644 index 00000000..b57438af --- /dev/null +++ b/test/transform/resource/after-delombok/WitherTypeAnnos.java @@ -0,0 +1,21 @@ +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +import java.util.List; +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) +@interface TA { +} +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) +@interface TB { +} +class WitherTypeAnnos { + @TA + @TB + final List<String> foo; + WitherTypeAnnos(@TA @TB List<String> foo) { + this.foo = foo; + } + @java.lang.SuppressWarnings("all") + public WitherTypeAnnos withFoo(@TA final List<String> foo) { + return this.foo == foo ? this : new WitherTypeAnnos(foo); + } +} diff --git a/test/transform/resource/after-ecj/BuilderDefaultsWarnings.java b/test/transform/resource/after-ecj/BuilderDefaultsWarnings.java index 236632d0..1078f452 100644 --- a/test/transform/resource/after-ecj/BuilderDefaultsWarnings.java +++ b/test/transform/resource/after-ecj/BuilderDefaultsWarnings.java @@ -16,13 +16,13 @@ public @Builder class BuilderDefaultsWarnings { this.z = z; return this; } - public @java.lang.SuppressWarnings("all") BuilderDefaultsWarningsBuilder item(String item) { + public @java.lang.SuppressWarnings("all") BuilderDefaultsWarningsBuilder item(final String item) { if ((this.items == null)) this.items = new java.util.ArrayList<String>(); this.items.add(item); return this; } - public @java.lang.SuppressWarnings("all") BuilderDefaultsWarningsBuilder items(java.util.Collection<? extends String> items) { + public @java.lang.SuppressWarnings("all") BuilderDefaultsWarningsBuilder items(final java.util.Collection<? extends String> items) { if ((this.items == null)) this.items = new java.util.ArrayList<String>(); this.items.addAll(items); diff --git a/test/transform/resource/after-ecj/BuilderSingularAnnotatedTypes.java b/test/transform/resource/after-ecj/BuilderSingularAnnotatedTypes.java new file mode 100644 index 00000000..26023e1a --- /dev/null +++ b/test/transform/resource/after-ecj/BuilderSingularAnnotatedTypes.java @@ -0,0 +1,121 @@ +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +import java.util.Set; +import java.util.Map; +import lombok.NonNull; +import lombok.Singular; +@Target(ElementType.TYPE_USE) @interface MyAnnotation { +} +@lombok.Builder class BuilderSingularAnnotatedTypes { + public static @java.lang.SuppressWarnings("all") class BuilderSingularAnnotatedTypesBuilder { + private @java.lang.SuppressWarnings("all") java.util.ArrayList<@MyAnnotation @NonNull String> foos; + private @java.lang.SuppressWarnings("all") java.util.ArrayList<@MyAnnotation @NonNull String> bars$key; + private @java.lang.SuppressWarnings("all") java.util.ArrayList<@MyAnnotation @NonNull Integer> bars$value; + @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypesBuilder() { + super(); + } + public @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypesBuilder foo(final @MyAnnotation @NonNull String foo) { + if ((foo == null)) + { + throw new java.lang.NullPointerException("foo is marked @NonNull but is null"); + } + if ((this.foos == null)) + this.foos = new java.util.ArrayList<@MyAnnotation @NonNull String>(); + this.foos.add(foo); + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypesBuilder foos(final java.util.Collection<? extends @MyAnnotation @NonNull String> foos) { + if ((this.foos == null)) + this.foos = new java.util.ArrayList<@MyAnnotation @NonNull String>(); + this.foos.addAll(foos); + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypesBuilder clearFoos() { + if ((this.foos != null)) + this.foos.clear(); + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypesBuilder bar(final @MyAnnotation @NonNull String barKey, final @MyAnnotation @NonNull Integer barValue) { + if ((barKey == null)) + { + throw new java.lang.NullPointerException("barKey is marked @NonNull but is null"); + } + if ((barValue == null)) + { + throw new java.lang.NullPointerException("barValue is marked @NonNull but is null"); + } + if ((this.bars$key == null)) + { + this.bars$key = new java.util.ArrayList<@MyAnnotation @NonNull String>(); + this.bars$value = new java.util.ArrayList<@MyAnnotation @NonNull Integer>(); + } + this.bars$key.add(barKey); + this.bars$value.add(barValue); + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypesBuilder bars(final java.util.Map<? extends @MyAnnotation @NonNull String, ? extends @MyAnnotation @NonNull Integer> bars) { + if ((this.bars$key == null)) + { + this.bars$key = new java.util.ArrayList<@MyAnnotation @NonNull String>(); + this.bars$value = new java.util.ArrayList<@MyAnnotation @NonNull Integer>(); + } + for (java.util.Map.Entry<? extends @MyAnnotation @NonNull String, ? extends @MyAnnotation @NonNull Integer> $lombokEntry : bars.entrySet()) + { + this.bars$key.add($lombokEntry.getKey()); + this.bars$value.add($lombokEntry.getValue()); + } + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypesBuilder clearBars() { + if ((this.bars$key != null)) + { + this.bars$key.clear(); + this.bars$value.clear(); + } + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypes build() { + java.util.Set<@MyAnnotation @NonNull String> foos; + switch (((this.foos == null) ? 0 : this.foos.size())) { + case 0 : + foos = java.util.Collections.emptySet(); + break; + case 1 : + foos = java.util.Collections.singleton(this.foos.get(0)); + break; + default : + foos = new java.util.LinkedHashSet<@MyAnnotation @NonNull String>(((this.foos.size() < 0x40000000) ? ((1 + this.foos.size()) + ((this.foos.size() - 3) / 3)) : java.lang.Integer.MAX_VALUE)); + foos.addAll(this.foos); + foos = java.util.Collections.unmodifiableSet(foos); + } + java.util.Map<@MyAnnotation @NonNull String, @MyAnnotation @NonNull Integer> bars; + switch (((this.bars$key == null) ? 0 : this.bars$key.size())) { + case 0 : + bars = java.util.Collections.emptyMap(); + break; + case 1 : + bars = java.util.Collections.singletonMap(this.bars$key.get(0), this.bars$value.get(0)); + break; + default : + bars = new java.util.LinkedHashMap<@MyAnnotation @NonNull String, @MyAnnotation @NonNull Integer>(((this.bars$key.size() < 0x40000000) ? ((1 + this.bars$key.size()) + ((this.bars$key.size() - 3) / 3)) : java.lang.Integer.MAX_VALUE)); + for (int $i = 0;; ($i < this.bars$key.size()); $i ++) + bars.put(this.bars$key.get($i), this.bars$value.get($i)); + bars = java.util.Collections.unmodifiableMap(bars); + } + return new BuilderSingularAnnotatedTypes(foos, bars); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (((((("BuilderSingularAnnotatedTypes.BuilderSingularAnnotatedTypesBuilder(foos=" + this.foos) + ", bars$key=") + this.bars$key) + ", bars$value=") + this.bars$value) + ")"); + } + } + private @Singular Set<@MyAnnotation @NonNull String> foos; + private @Singular Map<@MyAnnotation @NonNull String, @MyAnnotation @NonNull Integer> bars; + @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypes(final Set<@MyAnnotation @NonNull String> foos, final Map<@MyAnnotation @NonNull String, @MyAnnotation @NonNull Integer> bars) { + super(); + this.foos = foos; + this.bars = bars; + } + public static @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypesBuilder builder() { + return new BuilderSingularAnnotatedTypesBuilder(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/BuilderSingularGuavaListsSets.java b/test/transform/resource/after-ecj/BuilderSingularGuavaListsSets.java index 12c2b293..9b50d33b 100644 --- a/test/transform/resource/after-ecj/BuilderSingularGuavaListsSets.java +++ b/test/transform/resource/after-ecj/BuilderSingularGuavaListsSets.java @@ -14,13 +14,13 @@ import lombok.Singular; @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> card(T card) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> card(final T card) { if ((this.cards == null)) this.cards = com.google.common.collect.ImmutableList.builder(); this.cards.add(card); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> cards(java.lang.Iterable<? extends T> cards) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> cards(final java.lang.Iterable<? extends T> cards) { if ((this.cards == null)) this.cards = com.google.common.collect.ImmutableList.builder(); this.cards.addAll(cards); @@ -30,13 +30,13 @@ import lombok.Singular; this.cards = null; return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> frog(Number frog) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> frog(final Number frog) { if ((this.frogs == null)) this.frogs = com.google.common.collect.ImmutableList.builder(); this.frogs.add(frog); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> frogs(java.lang.Iterable<? extends Number> frogs) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> frogs(final java.lang.Iterable<? extends Number> frogs) { if ((this.frogs == null)) this.frogs = com.google.common.collect.ImmutableList.builder(); this.frogs.addAll(frogs); @@ -46,13 +46,13 @@ import lombok.Singular; this.frogs = null; return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> rawSet(java.lang.Object rawSet) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> rawSet(final java.lang.Object rawSet) { if ((this.rawSet == null)) this.rawSet = com.google.common.collect.ImmutableSet.builder(); this.rawSet.add(rawSet); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> rawSet(java.lang.Iterable<?> rawSet) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> rawSet(final java.lang.Iterable<?> rawSet) { if ((this.rawSet == null)) this.rawSet = com.google.common.collect.ImmutableSet.builder(); this.rawSet.addAll(rawSet); @@ -62,13 +62,13 @@ import lombok.Singular; this.rawSet = null; return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> pass(String pass) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> pass(final String pass) { if ((this.passes == null)) this.passes = com.google.common.collect.ImmutableSortedSet.naturalOrder(); this.passes.add(pass); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> passes(java.lang.Iterable<? extends String> passes) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> passes(final java.lang.Iterable<? extends String> passes) { if ((this.passes == null)) this.passes = com.google.common.collect.ImmutableSortedSet.naturalOrder(); this.passes.addAll(passes); @@ -78,13 +78,13 @@ import lombok.Singular; this.passes = null; return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> user(Number rowKey, Number columnKey, String value) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> user(final Number rowKey, final Number columnKey, final String value) { if ((this.users == null)) this.users = com.google.common.collect.ImmutableTable.builder(); this.users.put(rowKey, columnKey, value); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> users(com.google.common.collect.Table<? extends Number, ? extends Number, ? extends String> users) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> users(final com.google.common.collect.Table<? extends Number, ? extends Number, ? extends String> users) { if ((this.users == null)) this.users = com.google.common.collect.ImmutableTable.builder(); this.users.putAll(users); diff --git a/test/transform/resource/after-ecj/BuilderSingularGuavaMaps.java b/test/transform/resource/after-ecj/BuilderSingularGuavaMaps.java index 44533ac1..1dc04a07 100644 --- a/test/transform/resource/after-ecj/BuilderSingularGuavaMaps.java +++ b/test/transform/resource/after-ecj/BuilderSingularGuavaMaps.java @@ -10,13 +10,13 @@ import lombok.Singular; @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> battleaxe(K key, V value) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> battleaxe(final K key, final V value) { if ((this.battleaxes == null)) this.battleaxes = com.google.common.collect.ImmutableMap.builder(); this.battleaxes.put(key, value); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> battleaxes(java.util.Map<? extends K, ? extends V> battleaxes) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> battleaxes(final java.util.Map<? extends K, ? extends V> battleaxes) { if ((this.battleaxes == null)) this.battleaxes = com.google.common.collect.ImmutableMap.builder(); this.battleaxes.putAll(battleaxes); @@ -26,13 +26,13 @@ import lombok.Singular; this.battleaxes = null; return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> vertex(Integer key, V value) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> vertex(final Integer key, final V value) { if ((this.vertices == null)) this.vertices = com.google.common.collect.ImmutableSortedMap.naturalOrder(); this.vertices.put(key, value); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> vertices(java.util.Map<? extends Integer, ? extends V> vertices) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> vertices(final java.util.Map<? extends Integer, ? extends V> vertices) { if ((this.vertices == null)) this.vertices = com.google.common.collect.ImmutableSortedMap.naturalOrder(); this.vertices.putAll(vertices); @@ -42,13 +42,13 @@ import lombok.Singular; this.vertices = null; return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> rawMap(java.lang.Object key, java.lang.Object value) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> rawMap(final java.lang.Object key, final java.lang.Object value) { if ((this.rawMap == null)) this.rawMap = com.google.common.collect.ImmutableBiMap.builder(); this.rawMap.put(key, value); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> rawMap(java.util.Map<?, ?> rawMap) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> rawMap(final java.util.Map<?, ?> rawMap) { if ((this.rawMap == null)) this.rawMap = com.google.common.collect.ImmutableBiMap.builder(); this.rawMap.putAll(rawMap); diff --git a/test/transform/resource/after-ecj/BuilderSingularLists.java b/test/transform/resource/after-ecj/BuilderSingularLists.java index 3e093e1a..5bb13bad 100644 --- a/test/transform/resource/after-ecj/BuilderSingularLists.java +++ b/test/transform/resource/after-ecj/BuilderSingularLists.java @@ -10,13 +10,13 @@ import lombok.Singular; @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> child(T child) { + public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> child(final T child) { if ((this.children == null)) this.children = new java.util.ArrayList<T>(); this.children.add(child); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> children(java.util.Collection<? extends T> children) { + public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> children(final java.util.Collection<? extends T> children) { if ((this.children == null)) this.children = new java.util.ArrayList<T>(); this.children.addAll(children); @@ -27,13 +27,13 @@ import lombok.Singular; this.children.clear(); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> scarf(Number scarf) { + public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> scarf(final Number scarf) { if ((this.scarves == null)) this.scarves = new java.util.ArrayList<Number>(); this.scarves.add(scarf); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> scarves(java.util.Collection<? extends Number> scarves) { + public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> scarves(final java.util.Collection<? extends Number> scarves) { if ((this.scarves == null)) this.scarves = new java.util.ArrayList<Number>(); this.scarves.addAll(scarves); @@ -44,13 +44,13 @@ import lombok.Singular; this.scarves.clear(); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> rawList(java.lang.Object rawList) { + public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> rawList(final java.lang.Object rawList) { if ((this.rawList == null)) this.rawList = new java.util.ArrayList<java.lang.Object>(); this.rawList.add(rawList); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> rawList(java.util.Collection<?> rawList) { + public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> rawList(final java.util.Collection<?> rawList) { if ((this.rawList == null)) this.rawList = new java.util.ArrayList<java.lang.Object>(); this.rawList.addAll(rawList); diff --git a/test/transform/resource/after-ecj/BuilderSingularMaps.java b/test/transform/resource/after-ecj/BuilderSingularMaps.java index efcf5ef5..20945a13 100644 --- a/test/transform/resource/after-ecj/BuilderSingularMaps.java +++ b/test/transform/resource/after-ecj/BuilderSingularMaps.java @@ -14,7 +14,7 @@ import lombok.Singular; @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> woman(K womanKey, V womanValue) { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> woman(final K womanKey, final V womanValue) { if ((this.women$key == null)) { this.women$key = new java.util.ArrayList<K>(); @@ -24,7 +24,7 @@ import lombok.Singular; this.women$value.add(womanValue); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> women(java.util.Map<? extends K, ? extends V> women) { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> women(final java.util.Map<? extends K, ? extends V> women) { if ((this.women$key == null)) { this.women$key = new java.util.ArrayList<K>(); @@ -45,7 +45,7 @@ import lombok.Singular; } return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> man(K manKey, Number manValue) { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> man(final K manKey, final Number manValue) { if ((this.men$key == null)) { this.men$key = new java.util.ArrayList<K>(); @@ -55,7 +55,7 @@ import lombok.Singular; this.men$value.add(manValue); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> men(java.util.Map<? extends K, ? extends Number> men) { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> men(final java.util.Map<? extends K, ? extends Number> men) { if ((this.men$key == null)) { this.men$key = new java.util.ArrayList<K>(); @@ -76,7 +76,7 @@ import lombok.Singular; } return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> rawMap(java.lang.Object rawMapKey, java.lang.Object rawMapValue) { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> rawMap(final java.lang.Object rawMapKey, final java.lang.Object rawMapValue) { if ((this.rawMap$key == null)) { this.rawMap$key = new java.util.ArrayList<java.lang.Object>(); @@ -86,7 +86,7 @@ import lombok.Singular; this.rawMap$value.add(rawMapValue); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> rawMap(java.util.Map<?, ?> rawMap) { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> rawMap(final java.util.Map<?, ?> rawMap) { if ((this.rawMap$key == null)) { this.rawMap$key = new java.util.ArrayList<java.lang.Object>(); @@ -107,7 +107,7 @@ import lombok.Singular; } return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> stringMap(String stringMapKey, V stringMapValue) { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> stringMap(final String stringMapKey, final V stringMapValue) { if ((this.stringMap$key == null)) { this.stringMap$key = new java.util.ArrayList<String>(); @@ -117,7 +117,7 @@ import lombok.Singular; this.stringMap$value.add(stringMapValue); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> stringMap(java.util.Map<? extends String, ? extends V> stringMap) { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> stringMap(final java.util.Map<? extends String, ? extends V> stringMap) { if ((this.stringMap$key == null)) { this.stringMap$key = new java.util.ArrayList<String>(); diff --git a/test/transform/resource/after-ecj/BuilderSingularNoAuto.java b/test/transform/resource/after-ecj/BuilderSingularNoAuto.java index fa38efc3..4d27f459 100644 --- a/test/transform/resource/after-ecj/BuilderSingularNoAuto.java +++ b/test/transform/resource/after-ecj/BuilderSingularNoAuto.java @@ -8,13 +8,13 @@ import lombok.Singular; @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder things(String things) { + public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder things(final String things) { if ((this.things == null)) this.things = new java.util.ArrayList<String>(); this.things.add(things); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder things(java.util.Collection<? extends String> things) { + public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder things(final java.util.Collection<? extends String> things) { if ((this.things == null)) this.things = new java.util.ArrayList<String>(); this.things.addAll(things); @@ -25,13 +25,13 @@ import lombok.Singular; this.things.clear(); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder widget(String widget) { + public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder widget(final String widget) { if ((this.widgets == null)) this.widgets = new java.util.ArrayList<String>(); this.widgets.add(widget); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder widgets(java.util.Collection<? extends String> widgets) { + public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder widgets(final java.util.Collection<? extends String> widgets) { if ((this.widgets == null)) this.widgets = new java.util.ArrayList<String>(); this.widgets.addAll(widgets); @@ -42,13 +42,13 @@ import lombok.Singular; this.widgets.clear(); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder items(String items) { + public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder items(final String items) { if ((this.items == null)) this.items = new java.util.ArrayList<String>(); this.items.add(items); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder items(java.util.Collection<? extends String> items) { + public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder items(final java.util.Collection<? extends String> items) { if ((this.items == null)) this.items = new java.util.ArrayList<String>(); this.items.addAll(items); diff --git a/test/transform/resource/after-ecj/BuilderSingularRedirectToGuava.java b/test/transform/resource/after-ecj/BuilderSingularRedirectToGuava.java index 4823e46e..c0f78b57 100644 --- a/test/transform/resource/after-ecj/BuilderSingularRedirectToGuava.java +++ b/test/transform/resource/after-ecj/BuilderSingularRedirectToGuava.java @@ -10,13 +10,13 @@ import lombok.Singular; @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder dangerMouse(String dangerMouse) { + public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder dangerMouse(final String dangerMouse) { if ((this.dangerMice == null)) this.dangerMice = com.google.common.collect.ImmutableSet.builder(); this.dangerMice.add(dangerMouse); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder dangerMice(java.lang.Iterable<? extends String> dangerMice) { + public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder dangerMice(final java.lang.Iterable<? extends String> dangerMice) { if ((this.dangerMice == null)) this.dangerMice = com.google.common.collect.ImmutableSet.builder(); this.dangerMice.addAll(dangerMice); @@ -26,13 +26,13 @@ import lombok.Singular; this.dangerMice = null; return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder thing(Integer key, Number value) { + public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder thing(final Integer key, final Number value) { if ((this.things == null)) this.things = com.google.common.collect.ImmutableSortedMap.naturalOrder(); this.things.put(key, value); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder things(java.util.Map<? extends Integer, ? extends Number> things) { + public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder things(final java.util.Map<? extends Integer, ? extends Number> things) { if ((this.things == null)) this.things = com.google.common.collect.ImmutableSortedMap.naturalOrder(); this.things.putAll(things); @@ -42,13 +42,13 @@ import lombok.Singular; this.things = null; return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder doohickey(Class<?> doohickey) { + public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder doohickey(final Class<?> doohickey) { if ((this.doohickeys == null)) this.doohickeys = com.google.common.collect.ImmutableList.builder(); this.doohickeys.add(doohickey); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder doohickeys(java.lang.Iterable<? extends Class<?>> doohickeys) { + public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder doohickeys(final java.lang.Iterable<? extends Class<?>> doohickeys) { if ((this.doohickeys == null)) this.doohickeys = com.google.common.collect.ImmutableList.builder(); this.doohickeys.addAll(doohickeys); diff --git a/test/transform/resource/after-ecj/BuilderSingularSets.java b/test/transform/resource/after-ecj/BuilderSingularSets.java index bf403831..eb53b1cd 100644 --- a/test/transform/resource/after-ecj/BuilderSingularSets.java +++ b/test/transform/resource/after-ecj/BuilderSingularSets.java @@ -10,13 +10,13 @@ import lombok.Singular; @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> dangerMouse(T dangerMouse) { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> dangerMouse(final T dangerMouse) { if ((this.dangerMice == null)) this.dangerMice = new java.util.ArrayList<T>(); this.dangerMice.add(dangerMouse); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> dangerMice(java.util.Collection<? extends T> dangerMice) { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> dangerMice(final java.util.Collection<? extends T> dangerMice) { if ((this.dangerMice == null)) this.dangerMice = new java.util.ArrayList<T>(); this.dangerMice.addAll(dangerMice); @@ -27,13 +27,13 @@ import lombok.Singular; this.dangerMice.clear(); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> octopus(Number octopus) { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> octopus(final Number octopus) { if ((this.octopodes == null)) this.octopodes = new java.util.ArrayList<Number>(); this.octopodes.add(octopus); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> octopodes(java.util.Collection<? extends Number> octopodes) { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> octopodes(final java.util.Collection<? extends Number> octopodes) { if ((this.octopodes == null)) this.octopodes = new java.util.ArrayList<Number>(); this.octopodes.addAll(octopodes); @@ -44,13 +44,13 @@ import lombok.Singular; this.octopodes.clear(); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> rawSet(java.lang.Object rawSet) { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> rawSet(final java.lang.Object rawSet) { if ((this.rawSet == null)) this.rawSet = new java.util.ArrayList<java.lang.Object>(); this.rawSet.add(rawSet); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> rawSet(java.util.Collection<?> rawSet) { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> rawSet(final java.util.Collection<?> rawSet) { if ((this.rawSet == null)) this.rawSet = new java.util.ArrayList<java.lang.Object>(); this.rawSet.addAll(rawSet); @@ -61,13 +61,13 @@ import lombok.Singular; this.rawSet.clear(); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> stringSet(String stringSet) { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> stringSet(final String stringSet) { if ((this.stringSet == null)) this.stringSet = new java.util.ArrayList<String>(); this.stringSet.add(stringSet); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> stringSet(java.util.Collection<? extends String> stringSet) { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> stringSet(final java.util.Collection<? extends String> stringSet) { if ((this.stringSet == null)) this.stringSet = new java.util.ArrayList<String>(); this.stringSet.addAll(stringSet); diff --git a/test/transform/resource/after-ecj/BuilderSingularToBuilderWithNull.java b/test/transform/resource/after-ecj/BuilderSingularToBuilderWithNull.java index 7feff6e9..bbbf9268 100644 --- a/test/transform/resource/after-ecj/BuilderSingularToBuilderWithNull.java +++ b/test/transform/resource/after-ecj/BuilderSingularToBuilderWithNull.java @@ -5,13 +5,13 @@ import lombok.Singular; @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNullBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNullBuilder elem(String elem) { + public @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNullBuilder elem(final String elem) { if ((this.elems == null)) this.elems = new java.util.ArrayList<String>(); this.elems.add(elem); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNullBuilder elems(java.util.Collection<? extends String> elems) { + public @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNullBuilder elems(final java.util.Collection<? extends String> elems) { if ((this.elems == null)) this.elems = new java.util.ArrayList<String>(); this.elems.addAll(elems); diff --git a/test/transform/resource/after-ecj/BuilderSingularWithPrefixes.java b/test/transform/resource/after-ecj/BuilderSingularWithPrefixes.java index 12c299c6..31579497 100644 --- a/test/transform/resource/after-ecj/BuilderSingularWithPrefixes.java +++ b/test/transform/resource/after-ecj/BuilderSingularWithPrefixes.java @@ -5,13 +5,13 @@ import lombok.Singular; @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesBuilder elem(String elem) { + public @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesBuilder elem(final String elem) { if ((this.elems == null)) this.elems = new java.util.ArrayList<String>(); this.elems.add(elem); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesBuilder elems(java.util.Collection<? extends String> elems) { + public @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesBuilder elems(final java.util.Collection<? extends String> elems) { if ((this.elems == null)) this.elems = new java.util.ArrayList<String>(); this.elems.addAll(elems); diff --git a/test/transform/resource/after-ecj/BuilderTypeAnnos.java b/test/transform/resource/after-ecj/BuilderTypeAnnos.java new file mode 100644 index 00000000..1c310f38 --- /dev/null +++ b/test/transform/resource/after-ecj/BuilderTypeAnnos.java @@ -0,0 +1,33 @@ +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +import java.util.List; +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) @interface TA { +} +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) @interface TB { +} +@lombok.Builder class BuilderTypeAnnos { + public static @java.lang.SuppressWarnings("all") class BuilderTypeAnnosBuilder { + private @java.lang.SuppressWarnings("all") List<String> foo; + @java.lang.SuppressWarnings("all") BuilderTypeAnnosBuilder() { + super(); + } + public @java.lang.SuppressWarnings("all") BuilderTypeAnnosBuilder foo(final @TA List<String> foo) { + this.foo = foo; + return this; + } + public @java.lang.SuppressWarnings("all") BuilderTypeAnnos build() { + return new BuilderTypeAnnos(foo); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (("BuilderTypeAnnos.BuilderTypeAnnosBuilder(foo=" + this.foo) + ")"); + } + } + private @TA @TB List<String> foo; + @java.lang.SuppressWarnings("all") BuilderTypeAnnos(final @TA List<String> foo) { + super(); + this.foo = foo; + } + public static @java.lang.SuppressWarnings("all") BuilderTypeAnnosBuilder builder() { + return new BuilderTypeAnnosBuilder(); + } +} diff --git a/test/transform/resource/after-ecj/BuilderWithDeprecated.java b/test/transform/resource/after-ecj/BuilderWithDeprecated.java index 09a0b786..b429c3e7 100644 --- a/test/transform/resource/after-ecj/BuilderWithDeprecated.java +++ b/test/transform/resource/after-ecj/BuilderWithDeprecated.java @@ -18,13 +18,13 @@ public @Builder class BuilderWithDeprecated { this.dep2 = dep2; return this; } - public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedBuilder string(String string) { + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedBuilder string(final String string) { if ((this.strings == null)) this.strings = new java.util.ArrayList<String>(); this.strings.add(string); return this; } - public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedBuilder strings(java.util.Collection<? extends String> strings) { + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedBuilder strings(final java.util.Collection<? extends String> strings) { if ((this.strings == null)) this.strings = new java.util.ArrayList<String>(); this.strings.addAll(strings); @@ -35,13 +35,13 @@ public @Builder class BuilderWithDeprecated { this.strings.clear(); return this; } - public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedBuilder number(Integer number) { + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedBuilder number(final Integer number) { if ((this.numbers == null)) this.numbers = com.google.common.collect.ImmutableList.builder(); this.numbers.add(number); return this; } - public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedBuilder numbers(java.lang.Iterable<? extends Integer> numbers) { + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedBuilder numbers(final java.lang.Iterable<? extends Integer> numbers) { if ((this.numbers == null)) this.numbers = com.google.common.collect.ImmutableList.builder(); this.numbers.addAll(numbers); diff --git a/test/transform/resource/after-ecj/BuilderWithToBuilder.java b/test/transform/resource/after-ecj/BuilderWithToBuilder.java index a8935107..636dc42d 100644 --- a/test/transform/resource/after-ecj/BuilderWithToBuilder.java +++ b/test/transform/resource/after-ecj/BuilderWithToBuilder.java @@ -21,13 +21,13 @@ import lombok.Builder; this.foo = foo; return this; } - public @java.lang.SuppressWarnings("all") BuilderWithToBuilderBuilder<T> bar(T bar) { + public @java.lang.SuppressWarnings("all") BuilderWithToBuilderBuilder<T> bar(final T bar) { if ((this.bars == null)) this.bars = new java.util.ArrayList<T>(); this.bars.add(bar); return this; } - public @java.lang.SuppressWarnings("all") BuilderWithToBuilderBuilder<T> bars(java.util.Collection<? extends T> bars) { + public @java.lang.SuppressWarnings("all") BuilderWithToBuilderBuilder<T> bars(final java.util.Collection<? extends T> bars) { if ((this.bars == null)) this.bars = new java.util.ArrayList<T>(); this.bars.addAll(bars); diff --git a/test/transform/resource/after-ecj/ConstructorsTypeAnnos.java b/test/transform/resource/after-ecj/ConstructorsTypeAnnos.java new file mode 100644 index 00000000..3491239f --- /dev/null +++ b/test/transform/resource/after-ecj/ConstructorsTypeAnnos.java @@ -0,0 +1,14 @@ +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +import java.util.List; +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) @interface TA { +} +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) @interface TB { +} +@lombok.AllArgsConstructor class ConstructorsTypeAnnos { + @TA @TB List<String> foo; + public @java.lang.SuppressWarnings("all") ConstructorsTypeAnnos(final @TA List<String> foo) { + super(); + this.foo = foo; + } +} diff --git a/test/transform/resource/after-ecj/GetterTypeAnnos.java b/test/transform/resource/after-ecj/GetterTypeAnnos.java new file mode 100644 index 00000000..9ffc7f1c --- /dev/null +++ b/test/transform/resource/after-ecj/GetterTypeAnnos.java @@ -0,0 +1,17 @@ +import lombok.Getter; +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +import java.util.List; +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) @interface TA { +} +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) @interface TB { +} +class GetterTypeAnnos { + @Getter @TA @TB List<String> foo; + GetterTypeAnnos() { + super(); + } + public @TA @java.lang.SuppressWarnings("all") List<String> getFoo() { + return this.foo; + } +} diff --git a/test/transform/resource/after-ecj/SetterTypeAnnos.java b/test/transform/resource/after-ecj/SetterTypeAnnos.java new file mode 100644 index 00000000..860694ea --- /dev/null +++ b/test/transform/resource/after-ecj/SetterTypeAnnos.java @@ -0,0 +1,17 @@ +import lombok.Setter; +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +import java.util.List; +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) @interface TA { +} +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) @interface TB { +} +class SetterTypeAnnos { + @Setter @TA @TB List<String> foo; + SetterTypeAnnos() { + super(); + } + public @java.lang.SuppressWarnings("all") void setFoo(final @TA List<String> foo) { + this.foo = foo; + } +} diff --git a/test/transform/resource/after-ecj/SuperBuilderBasic.java b/test/transform/resource/after-ecj/SuperBuilderBasic.java index 11fd8498..95cf5f01 100644 --- a/test/transform/resource/after-ecj/SuperBuilderBasic.java +++ b/test/transform/resource/after-ecj/SuperBuilderBasic.java @@ -13,13 +13,13 @@ public class SuperBuilderBasic { this.field1 = field1;
return self();
}
- public @java.lang.SuppressWarnings("all") B item(String item) {
+ public @java.lang.SuppressWarnings("all") B item(final String item) {
if ((this.items == null))
this.items = new java.util.ArrayList<String>();
this.items.add(item);
return self();
}
- public @java.lang.SuppressWarnings("all") B items(java.util.Collection<? extends String> items) {
+ public @java.lang.SuppressWarnings("all") B items(final java.util.Collection<? extends String> items) {
if ((this.items == null))
this.items = new java.util.ArrayList<String>();
this.items.addAll(items);
diff --git a/test/transform/resource/after-ecj/SuperBuilderSingularAnnotatedTypes.java b/test/transform/resource/after-ecj/SuperBuilderSingularAnnotatedTypes.java new file mode 100644 index 00000000..bb02024d --- /dev/null +++ b/test/transform/resource/after-ecj/SuperBuilderSingularAnnotatedTypes.java @@ -0,0 +1,131 @@ +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +import java.util.Set; +import java.util.Map; +import lombok.NonNull; +import lombok.Singular; +@Target(ElementType.TYPE_USE) @interface MyAnnotation { +} +@lombok.experimental.SuperBuilder class SuperBuilderSingularAnnotatedTypes { + public static abstract @java.lang.SuppressWarnings("all") class SuperBuilderSingularAnnotatedTypesBuilder<C extends SuperBuilderSingularAnnotatedTypes, B extends SuperBuilderSingularAnnotatedTypesBuilder<C, B>> { + private @java.lang.SuppressWarnings("all") java.util.ArrayList<@MyAnnotation @NonNull String> foos; + private @java.lang.SuppressWarnings("all") java.util.ArrayList<@MyAnnotation @NonNull String> bars$key; + private @java.lang.SuppressWarnings("all") java.util.ArrayList<@MyAnnotation @NonNull Integer> bars$value; + public SuperBuilderSingularAnnotatedTypesBuilder() { + super(); + } + protected abstract @java.lang.SuppressWarnings("all") B self(); + public abstract @java.lang.SuppressWarnings("all") C build(); + public @java.lang.SuppressWarnings("all") B foo(final @MyAnnotation @NonNull String foo) { + if ((foo == null)) + { + throw new java.lang.NullPointerException("foo is marked @NonNull but is null"); + } + if ((this.foos == null)) + this.foos = new java.util.ArrayList<@MyAnnotation @NonNull String>(); + this.foos.add(foo); + return self(); + } + public @java.lang.SuppressWarnings("all") B foos(final java.util.Collection<? extends @MyAnnotation @NonNull String> foos) { + if ((this.foos == null)) + this.foos = new java.util.ArrayList<@MyAnnotation @NonNull String>(); + this.foos.addAll(foos); + return self(); + } + public @java.lang.SuppressWarnings("all") B clearFoos() { + if ((this.foos != null)) + this.foos.clear(); + return self(); + } + public @java.lang.SuppressWarnings("all") B bar(final @MyAnnotation @NonNull String barKey, final @MyAnnotation @NonNull Integer barValue) { + if ((barKey == null)) + { + throw new java.lang.NullPointerException("barKey is marked @NonNull but is null"); + } + if ((barValue == null)) + { + throw new java.lang.NullPointerException("barValue is marked @NonNull but is null"); + } + if ((this.bars$key == null)) + { + this.bars$key = new java.util.ArrayList<@MyAnnotation @NonNull String>(); + this.bars$value = new java.util.ArrayList<@MyAnnotation @NonNull Integer>(); + } + this.bars$key.add(barKey); + this.bars$value.add(barValue); + return self(); + } + public @java.lang.SuppressWarnings("all") B bars(final java.util.Map<? extends @MyAnnotation @NonNull String, ? extends @MyAnnotation @NonNull Integer> bars) { + if ((this.bars$key == null)) + { + this.bars$key = new java.util.ArrayList<@MyAnnotation @NonNull String>(); + this.bars$value = new java.util.ArrayList<@MyAnnotation @NonNull Integer>(); + } + for (java.util.Map.Entry<? extends @MyAnnotation @NonNull String, ? extends @MyAnnotation @NonNull Integer> $lombokEntry : bars.entrySet()) + { + this.bars$key.add($lombokEntry.getKey()); + this.bars$value.add($lombokEntry.getValue()); + } + return self(); + } + public @java.lang.SuppressWarnings("all") B clearBars() { + if ((this.bars$key != null)) + { + this.bars$key.clear(); + this.bars$value.clear(); + } + return self(); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (((((("SuperBuilderSingularAnnotatedTypes.SuperBuilderSingularAnnotatedTypesBuilder(foos=" + this.foos) + ", bars$key=") + this.bars$key) + ", bars$value=") + this.bars$value) + ")"); + } + } + private static final @java.lang.SuppressWarnings("all") class SuperBuilderSingularAnnotatedTypesBuilderImpl extends SuperBuilderSingularAnnotatedTypesBuilder<SuperBuilderSingularAnnotatedTypes, SuperBuilderSingularAnnotatedTypesBuilderImpl> { + private SuperBuilderSingularAnnotatedTypesBuilderImpl() { + super(); + } + protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderSingularAnnotatedTypesBuilderImpl self() { + return this; + } + public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderSingularAnnotatedTypes build() { + return new SuperBuilderSingularAnnotatedTypes(this); + } + } + private @Singular Set<@MyAnnotation @NonNull String> foos; + private @Singular Map<@MyAnnotation @NonNull String, @MyAnnotation @NonNull Integer> bars; + protected @java.lang.SuppressWarnings("all") SuperBuilderSingularAnnotatedTypes(final SuperBuilderSingularAnnotatedTypesBuilder<?, ?> b) { + super(); + java.util.Set<@MyAnnotation @NonNull String> foos; + switch (((b.foos == null) ? 0 : b.foos.size())) { + case 0 : + foos = java.util.Collections.emptySet(); + break; + case 1 : + foos = java.util.Collections.singleton(b.foos.get(0)); + break; + default : + foos = new java.util.LinkedHashSet<@MyAnnotation @NonNull String>(((b.foos.size() < 0x40000000) ? ((1 + b.foos.size()) + ((b.foos.size() - 3) / 3)) : java.lang.Integer.MAX_VALUE)); + foos.addAll(b.foos); + foos = java.util.Collections.unmodifiableSet(foos); + } + this.foos = foos; + java.util.Map<@MyAnnotation @NonNull String, @MyAnnotation @NonNull Integer> bars; + switch (((b.bars$key == null) ? 0 : b.bars$key.size())) { + case 0 : + bars = java.util.Collections.emptyMap(); + break; + case 1 : + bars = java.util.Collections.singletonMap(b.bars$key.get(0), b.bars$value.get(0)); + break; + default : + bars = new java.util.LinkedHashMap<@MyAnnotation @NonNull String, @MyAnnotation @NonNull Integer>(((b.bars$key.size() < 0x40000000) ? ((1 + b.bars$key.size()) + ((b.bars$key.size() - 3) / 3)) : java.lang.Integer.MAX_VALUE)); + for (int $i = 0;; ($i < b.bars$key.size()); $i ++) + bars.put(b.bars$key.get($i), b.bars$value.get($i)); + bars = java.util.Collections.unmodifiableMap(bars); + } + this.bars = bars; + } + public static @java.lang.SuppressWarnings("all") SuperBuilderSingularAnnotatedTypesBuilder<?, ?> builder() { + return new SuperBuilderSingularAnnotatedTypesBuilderImpl(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/SuperBuilderWithCustomBuilderMethod.java b/test/transform/resource/after-ecj/SuperBuilderWithCustomBuilderMethod.java index ed0655c7..0ec8921d 100644 --- a/test/transform/resource/after-ecj/SuperBuilderWithCustomBuilderMethod.java +++ b/test/transform/resource/after-ecj/SuperBuilderWithCustomBuilderMethod.java @@ -13,13 +13,13 @@ public class SuperBuilderWithCustomBuilderMethod { this.field1 = field1;
return self();
}
- public @java.lang.SuppressWarnings("all") B item(String item) {
+ public @java.lang.SuppressWarnings("all") B item(final String item) {
if ((this.items == null))
this.items = new java.util.ArrayList<String>();
this.items.add(item);
return self();
}
- public @java.lang.SuppressWarnings("all") B items(java.util.Collection<? extends String> items) {
+ public @java.lang.SuppressWarnings("all") B items(final java.util.Collection<? extends String> items) {
if ((this.items == null))
this.items = new java.util.ArrayList<String>();
this.items.addAll(items);
diff --git a/test/transform/resource/after-ecj/SuperBuilderWithGenerics.java b/test/transform/resource/after-ecj/SuperBuilderWithGenerics.java index 0166e375..465704bb 100644 --- a/test/transform/resource/after-ecj/SuperBuilderWithGenerics.java +++ b/test/transform/resource/after-ecj/SuperBuilderWithGenerics.java @@ -13,13 +13,13 @@ public class SuperBuilderWithGenerics { this.field1 = field1;
return self();
}
- public @java.lang.SuppressWarnings("all") B item(String item) {
+ public @java.lang.SuppressWarnings("all") B item(final String item) {
if ((this.items == null))
this.items = new java.util.ArrayList<String>();
this.items.add(item);
return self();
}
- public @java.lang.SuppressWarnings("all") B items(java.util.Collection<? extends String> items) {
+ public @java.lang.SuppressWarnings("all") B items(final java.util.Collection<? extends String> items) {
if ((this.items == null))
this.items = new java.util.ArrayList<String>();
this.items.addAll(items);
diff --git a/test/transform/resource/after-ecj/SuperBuilderWithGenerics2.java b/test/transform/resource/after-ecj/SuperBuilderWithGenerics2.java index 28b026ea..8429ee35 100644 --- a/test/transform/resource/after-ecj/SuperBuilderWithGenerics2.java +++ b/test/transform/resource/after-ecj/SuperBuilderWithGenerics2.java @@ -13,13 +13,13 @@ public class SuperBuilderWithGenerics2 { this.field1 = field1;
return self();
}
- public @java.lang.SuppressWarnings("all") B item(String item) {
+ public @java.lang.SuppressWarnings("all") B item(final String item) {
if ((this.items == null))
this.items = new java.util.ArrayList<String>();
this.items.add(item);
return self();
}
- public @java.lang.SuppressWarnings("all") B items(java.util.Collection<? extends String> items) {
+ public @java.lang.SuppressWarnings("all") B items(final java.util.Collection<? extends String> items) {
if ((this.items == null))
this.items = new java.util.ArrayList<String>();
this.items.addAll(items);
diff --git a/test/transform/resource/after-ecj/SuperBuilderWithNonNull.java b/test/transform/resource/after-ecj/SuperBuilderWithNonNull.java index 106b8326..1c4bd53d 100644 --- a/test/transform/resource/after-ecj/SuperBuilderWithNonNull.java +++ b/test/transform/resource/after-ecj/SuperBuilderWithNonNull.java @@ -9,7 +9,7 @@ public class SuperBuilderWithNonNull { }
protected abstract @java.lang.SuppressWarnings("all") B self();
public abstract @java.lang.SuppressWarnings("all") C build();
- public @java.lang.SuppressWarnings("all") B nonNullParentField(final String nonNullParentField) {
+ public @java.lang.SuppressWarnings("all") B nonNullParentField(final @lombok.NonNull String nonNullParentField) {
this.nonNullParentField = nonNullParentField;
nonNullParentField$set = true;
return self();
@@ -56,7 +56,7 @@ public class SuperBuilderWithNonNull { }
protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
- public @java.lang.SuppressWarnings("all") B nonNullChildField(final String nonNullChildField) {
+ public @java.lang.SuppressWarnings("all") B nonNullChildField(final @lombok.NonNull String nonNullChildField) {
this.nonNullChildField = nonNullChildField;
return self();
}
diff --git a/test/transform/resource/after-ecj/SuperBuilderWithPrefixes.java b/test/transform/resource/after-ecj/SuperBuilderWithPrefixes.java index 33400b3c..5dbdfacc 100644 --- a/test/transform/resource/after-ecj/SuperBuilderWithPrefixes.java +++ b/test/transform/resource/after-ecj/SuperBuilderWithPrefixes.java @@ -16,13 +16,13 @@ this.otherField = otherField; return self(); } - public @java.lang.SuppressWarnings("all") B item(String item) { + public @java.lang.SuppressWarnings("all") B item(final String item) { if ((this.items == null)) this.items = new java.util.ArrayList<String>(); this.items.add(item); return self(); } - public @java.lang.SuppressWarnings("all") B items(java.util.Collection<? extends String> items) { + public @java.lang.SuppressWarnings("all") B items(final java.util.Collection<? extends String> items) { if ((this.items == null)) this.items = new java.util.ArrayList<String>(); this.items.addAll(items); diff --git a/test/transform/resource/after-ecj/WitherTypeAnnos.java b/test/transform/resource/after-ecj/WitherTypeAnnos.java new file mode 100644 index 00000000..e41d9e13 --- /dev/null +++ b/test/transform/resource/after-ecj/WitherTypeAnnos.java @@ -0,0 +1,18 @@ +import lombok.experimental.Wither; +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +import java.util.List; +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) @interface TA { +} +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) @interface TB { +} +class WitherTypeAnnos { + final @Wither @TA @TB List<String> foo; + WitherTypeAnnos(@TA @TB List<String> foo) { + super(); + this.foo = foo; + } + public @java.lang.SuppressWarnings("all") WitherTypeAnnos withFoo(final @TA List<String> foo) { + return ((this.foo == foo) ? this : new WitherTypeAnnos(foo)); + } +} diff --git a/test/transform/resource/before/BuilderSingularAnnotatedTypes.java b/test/transform/resource/before/BuilderSingularAnnotatedTypes.java new file mode 100644 index 00000000..d54fed8d --- /dev/null +++ b/test/transform/resource/before/BuilderSingularAnnotatedTypes.java @@ -0,0 +1,14 @@ +//VERSION 8: +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +import java.util.Set; +import java.util.Map; +import lombok.NonNull; +import lombok.Singular; +@Target(ElementType.TYPE_USE) +@interface MyAnnotation {} +@lombok.Builder +class BuilderSingularAnnotatedTypes { + @Singular private Set<@MyAnnotation @NonNull String> foos; + @Singular private Map<@MyAnnotation @NonNull String, @MyAnnotation @NonNull Integer> bars; +} diff --git a/test/transform/resource/before/BuilderTypeAnnos.java b/test/transform/resource/before/BuilderTypeAnnos.java new file mode 100644 index 00000000..6b7bc1d8 --- /dev/null +++ b/test/transform/resource/before/BuilderTypeAnnos.java @@ -0,0 +1,14 @@ +//CONF: lombok.copyableAnnotations += TA +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +import java.util.List; +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) +@interface TA { +} +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) +@interface TB { +} +@lombok.Builder +class BuilderTypeAnnos { + private @TA @TB List<String> foo; +} diff --git a/test/transform/resource/before/ConstructorsTypeAnnos.java b/test/transform/resource/before/ConstructorsTypeAnnos.java new file mode 100644 index 00000000..d767f321 --- /dev/null +++ b/test/transform/resource/before/ConstructorsTypeAnnos.java @@ -0,0 +1,14 @@ +//CONF: lombok.copyableAnnotations += TA +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +import java.util.List; +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) +@interface TA { +} +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) +@interface TB { +} +@lombok.AllArgsConstructor +class ConstructorsTypeAnnos { + @TA @TB List<String> foo; +} diff --git a/test/transform/resource/before/GetterTypeAnnos.java b/test/transform/resource/before/GetterTypeAnnos.java new file mode 100644 index 00000000..34177503 --- /dev/null +++ b/test/transform/resource/before/GetterTypeAnnos.java @@ -0,0 +1,15 @@ +//CONF: lombok.copyableAnnotations += TA +import lombok.Getter; +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +import java.util.List; +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) +@interface TA { +} +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) +@interface TB { +} +class GetterTypeAnnos { + @Getter + @TA @TB List<String> foo; +} diff --git a/test/transform/resource/before/SetterTypeAnnos.java b/test/transform/resource/before/SetterTypeAnnos.java new file mode 100644 index 00000000..8031136d --- /dev/null +++ b/test/transform/resource/before/SetterTypeAnnos.java @@ -0,0 +1,15 @@ +//CONF: lombok.copyableAnnotations += TA +import lombok.Setter; +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +import java.util.List; +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) +@interface TA { +} +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) +@interface TB { +} +class SetterTypeAnnos { + @Setter + @TA @TB List<String> foo; +} diff --git a/test/transform/resource/before/SuperBuilderSingularAnnotatedTypes.java b/test/transform/resource/before/SuperBuilderSingularAnnotatedTypes.java new file mode 100644 index 00000000..d26352d2 --- /dev/null +++ b/test/transform/resource/before/SuperBuilderSingularAnnotatedTypes.java @@ -0,0 +1,14 @@ +//VERSION 8: +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +import java.util.Set; +import java.util.Map; +import lombok.NonNull; +import lombok.Singular; +@Target(ElementType.TYPE_USE) +@interface MyAnnotation {} +@lombok.experimental.SuperBuilder +class SuperBuilderSingularAnnotatedTypes { + @Singular private Set<@MyAnnotation @NonNull String> foos; + @Singular private Map<@MyAnnotation @NonNull String, @MyAnnotation @NonNull Integer> bars; +} diff --git a/test/transform/resource/before/WitherTypeAnnos.java b/test/transform/resource/before/WitherTypeAnnos.java new file mode 100644 index 00000000..97cd3d9f --- /dev/null +++ b/test/transform/resource/before/WitherTypeAnnos.java @@ -0,0 +1,18 @@ +//CONF: lombok.copyableAnnotations += TA +import lombok.experimental.Wither; +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +import java.util.List; +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) +@interface TA { +} +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) +@interface TB { +} +class WitherTypeAnnos { + @Wither final @TA @TB List<String> foo; + + WitherTypeAnnos(@TA @TB List<String> foo) { + this.foo = foo; + } +} |