From 36287f2ff9ed2f809f8c1c76155919417ad04d3c Mon Sep 17 00:00:00 2001 From: Caleb Brinkman Date: Thu, 12 Sep 2019 11:27:08 -0500 Subject: Duplicate builder tests with setter prefix --- .../BuilderWithExistingBuilderClassWithSetterPrefix.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 test/transform/resource/before/BuilderWithExistingBuilderClassWithSetterPrefix.java (limited to 'test/transform/resource/before/BuilderWithExistingBuilderClassWithSetterPrefix.java') diff --git a/test/transform/resource/before/BuilderWithExistingBuilderClassWithSetterPrefix.java b/test/transform/resource/before/BuilderWithExistingBuilderClassWithSetterPrefix.java new file mode 100644 index 00000000..f931d507 --- /dev/null +++ b/test/transform/resource/before/BuilderWithExistingBuilderClassWithSetterPrefix.java @@ -0,0 +1,15 @@ +import lombok.Builder; + +class BuilderWithExistingBuilderClass { + @Builder(setterPrefix = "with") + public static BuilderWithExistingBuilderClass staticMethod(Z arg1, boolean arg2, String arg3) { + return null; + } + + public static class BuilderWithExistingBuilderClassBuilder { + private Z arg1; + + public void withArg2(boolean arg) { + } + } +} -- cgit From f222050d13364565692cd585ff5d9a055498c52e Mon Sep 17 00:00:00 2001 From: Caleb Brinkman Date: Thu, 12 Sep 2019 12:02:04 -0500 Subject: Fix class names in before --- .../before/BuilderSingularAnnotatedTypesWithSetterPrefix.java | 2 +- .../before/BuilderSingularGuavaListsSetsWithSetterPrefix.java | 2 +- .../resource/before/BuilderSingularGuavaMapsWithPrefix.java | 2 +- .../resource/before/BuilderSingularListsWithSetterPrefix.java | 2 +- .../resource/before/BuilderSingularMapsWithSetterPrefix.java | 2 +- .../resource/before/BuilderSingularNoAutoWithSetterPrefix.java | 2 +- .../before/BuilderSingularRedirectToGuavaWithSetterPrefix.java | 2 +- .../resource/before/BuilderSingularSetsWithSetterPrefix.java | 2 +- .../before/BuilderSingularToBuilderWithNullWithSetterPrefix.java | 2 +- ...BuilderSingularWildcardListsWithToBuilderWithSetterPrefix.java | 2 +- .../before/BuilderSingularWithPrefixesWithSetterPrefix.java | 2 +- .../resource/before/BuilderTypeAnnosWithSetterPrefix.java | 2 +- .../resource/before/BuilderValueDataWithSetterPrefix.java | 6 +++--- .../resource/before/BuilderWithAccessorsWithSetterPrefix.java | 2 +- .../resource/before/BuilderWithBadNamesWithSetterPrefix.java | 2 +- .../resource/before/BuilderWithDeprecatedWithSetterPrefix.java | 2 +- .../before/BuilderWithExistingBuilderClassWithSetterPrefix.java | 6 +++--- .../before/BuilderWithNoBuilderMethodWithSetterPrefix.java | 2 +- .../resource/before/BuilderWithNonNullWithSetterPrefix.java | 2 +- .../before/BuilderWithRecursiveGenericsWithSetterPrefix.java | 2 +- .../resource/before/BuilderWithToBuilderWithSetterPrefix.java | 6 +++--- .../resource/before/BuilderWithTolerateWithSetterPrefix.java | 8 ++++---- 22 files changed, 31 insertions(+), 31 deletions(-) (limited to 'test/transform/resource/before/BuilderWithExistingBuilderClassWithSetterPrefix.java') diff --git a/test/transform/resource/before/BuilderSingularAnnotatedTypesWithSetterPrefix.java b/test/transform/resource/before/BuilderSingularAnnotatedTypesWithSetterPrefix.java index 2ef83429..ef8cb2e3 100644 --- a/test/transform/resource/before/BuilderSingularAnnotatedTypesWithSetterPrefix.java +++ b/test/transform/resource/before/BuilderSingularAnnotatedTypesWithSetterPrefix.java @@ -8,7 +8,7 @@ import lombok.Singular; @Target(ElementType.TYPE_USE) @interface MyAnnotation {} @lombok.Builder(setterPrefix = "with") -class BuilderSingularAnnotatedTypes { +class BuilderSingularAnnotatedTypesWithSetterPrefix { @Singular private Set<@MyAnnotation @NonNull String> foos; @Singular private Map<@MyAnnotation @NonNull String, @MyAnnotation @NonNull Integer> bars; } diff --git a/test/transform/resource/before/BuilderSingularGuavaListsSetsWithSetterPrefix.java b/test/transform/resource/before/BuilderSingularGuavaListsSetsWithSetterPrefix.java index 678b2e9f..af02adb6 100644 --- a/test/transform/resource/before/BuilderSingularGuavaListsSetsWithSetterPrefix.java +++ b/test/transform/resource/before/BuilderSingularGuavaListsSetsWithSetterPrefix.java @@ -7,7 +7,7 @@ import com.google.common.collect.ImmutableTable; import lombok.Singular; @lombok.Builder(setterPrefix = "with") -class BuilderSingularGuavaListsSets { +class BuilderSingularGuavaListsSetsWithSetterPrefix { @Singular private ImmutableList cards; @Singular private ImmutableCollection frogs; @SuppressWarnings("all") @Singular("rawSet") private ImmutableSet rawSet; diff --git a/test/transform/resource/before/BuilderSingularGuavaMapsWithPrefix.java b/test/transform/resource/before/BuilderSingularGuavaMapsWithPrefix.java index 89de9a9c..a2b48cb3 100644 --- a/test/transform/resource/before/BuilderSingularGuavaMapsWithPrefix.java +++ b/test/transform/resource/before/BuilderSingularGuavaMapsWithPrefix.java @@ -5,7 +5,7 @@ import com.google.common.collect.ImmutableSortedMap; import lombok.Singular; @lombok.Builder(setterPrefix = "with") -class BuilderSingularGuavaMaps { +class BuilderSingularGuavaMapsWithSetterPrefix { @Singular private ImmutableMap battleaxes; @Singular private ImmutableSortedMap vertices; @SuppressWarnings("all") @Singular("rawMap") private ImmutableBiMap rawMap; diff --git a/test/transform/resource/before/BuilderSingularListsWithSetterPrefix.java b/test/transform/resource/before/BuilderSingularListsWithSetterPrefix.java index 101e7972..fd53d97f 100644 --- a/test/transform/resource/before/BuilderSingularListsWithSetterPrefix.java +++ b/test/transform/resource/before/BuilderSingularListsWithSetterPrefix.java @@ -4,7 +4,7 @@ import java.util.Collection; import lombok.Singular; @lombok.Builder(setterPrefix = "with") -class BuilderSingularLists { +class BuilderSingularListsWithSetterPrefix { @Singular private List children; @Singular private Collection scarves; @SuppressWarnings("all") @Singular("rawList") private List rawList; diff --git a/test/transform/resource/before/BuilderSingularMapsWithSetterPrefix.java b/test/transform/resource/before/BuilderSingularMapsWithSetterPrefix.java index e77bcf6e..728ad59a 100644 --- a/test/transform/resource/before/BuilderSingularMapsWithSetterPrefix.java +++ b/test/transform/resource/before/BuilderSingularMapsWithSetterPrefix.java @@ -7,7 +7,7 @@ import java.util.SortedMap; import lombok.Singular; @lombok.Builder(setterPrefix = "with") -class BuilderSingularMaps { +class BuilderSingularMapsWithSetterPrefix { @Singular private Map women; @Singular private SortedMap men; @SuppressWarnings("all") @Singular("rawMap") private Map rawMap; diff --git a/test/transform/resource/before/BuilderSingularNoAutoWithSetterPrefix.java b/test/transform/resource/before/BuilderSingularNoAutoWithSetterPrefix.java index 0474c764..fa55c553 100644 --- a/test/transform/resource/before/BuilderSingularNoAutoWithSetterPrefix.java +++ b/test/transform/resource/before/BuilderSingularNoAutoWithSetterPrefix.java @@ -4,7 +4,7 @@ import java.util.List; import lombok.Singular; @lombok.Builder(setterPrefix = "with") -class BuilderSingularNoAuto { +class BuilderSingularNoAutoWithSetterPrefix { @Singular private List things; @Singular("widget") private List widgets; @Singular private List items; diff --git a/test/transform/resource/before/BuilderSingularRedirectToGuavaWithSetterPrefix.java b/test/transform/resource/before/BuilderSingularRedirectToGuavaWithSetterPrefix.java index c3fdc7c6..7281141d 100644 --- a/test/transform/resource/before/BuilderSingularRedirectToGuavaWithSetterPrefix.java +++ b/test/transform/resource/before/BuilderSingularRedirectToGuavaWithSetterPrefix.java @@ -6,7 +6,7 @@ import java.util.Collection; import lombok.Singular; @lombok.Builder(setterPrefix = "with") -class BuilderSingularRedirectToGuava { +class BuilderSingularRedirectToGuavaWithSetterPrefix { @Singular private Set dangerMice; @Singular private NavigableMap things; @Singular private Collection> doohickeys; diff --git a/test/transform/resource/before/BuilderSingularSetsWithSetterPrefix.java b/test/transform/resource/before/BuilderSingularSetsWithSetterPrefix.java index 16026f2d..d2824109 100644 --- a/test/transform/resource/before/BuilderSingularSetsWithSetterPrefix.java +++ b/test/transform/resource/before/BuilderSingularSetsWithSetterPrefix.java @@ -4,7 +4,7 @@ import java.util.SortedSet; import lombok.Singular; @lombok.Builder(setterPrefix = "with") -class BuilderSingularSets { +class BuilderSingularSetsWithSetterPrefix { @Singular private Set dangerMice; @Singular private SortedSet octopodes; @SuppressWarnings("all") @Singular("rawSet") private Set rawSet; diff --git a/test/transform/resource/before/BuilderSingularToBuilderWithNullWithSetterPrefix.java b/test/transform/resource/before/BuilderSingularToBuilderWithNullWithSetterPrefix.java index f7a411f0..845b38df 100644 --- a/test/transform/resource/before/BuilderSingularToBuilderWithNullWithSetterPrefix.java +++ b/test/transform/resource/before/BuilderSingularToBuilderWithNullWithSetterPrefix.java @@ -1,7 +1,7 @@ import lombok.Singular; @lombok.Builder(toBuilder = true, setterPrefix = "with") -class BuilderSingularToBuilderWithNull { +class BuilderSingularToBuilderWithNullWithSetterPrefix { @Singular private java.util.List elems; public static void test() { diff --git a/test/transform/resource/before/BuilderSingularWildcardListsWithToBuilderWithSetterPrefix.java b/test/transform/resource/before/BuilderSingularWildcardListsWithToBuilderWithSetterPrefix.java index 817f4be5..cea10bab 100644 --- a/test/transform/resource/before/BuilderSingularWildcardListsWithToBuilderWithSetterPrefix.java +++ b/test/transform/resource/before/BuilderSingularWildcardListsWithToBuilderWithSetterPrefix.java @@ -4,7 +4,7 @@ import java.util.Collection; import lombok.Singular; @lombok.Builder(toBuilder = true, setterPrefix = "with") -class BuilderSingularWildcardListsWithToBuilder { +class BuilderSingularWildcardListsWithToBuilderWithSetterPrefix { @Singular private List objects; @Singular private Collection numbers; } diff --git a/test/transform/resource/before/BuilderSingularWithPrefixesWithSetterPrefix.java b/test/transform/resource/before/BuilderSingularWithPrefixesWithSetterPrefix.java index 63df4a71..1b953668 100644 --- a/test/transform/resource/before/BuilderSingularWithPrefixesWithSetterPrefix.java +++ b/test/transform/resource/before/BuilderSingularWithPrefixesWithSetterPrefix.java @@ -2,6 +2,6 @@ import lombok.Singular; @lombok.Builder(setterPrefix = "with") @lombok.experimental.Accessors(prefix = "_") -class BuilderSingularWithPrefixes { +class BuilderSingularWithPrefixesWithSetterPrefix { @Singular private java.util.List _elems; } diff --git a/test/transform/resource/before/BuilderTypeAnnosWithSetterPrefix.java b/test/transform/resource/before/BuilderTypeAnnosWithSetterPrefix.java index 65faf01d..4adde2a0 100644 --- a/test/transform/resource/before/BuilderTypeAnnosWithSetterPrefix.java +++ b/test/transform/resource/before/BuilderTypeAnnosWithSetterPrefix.java @@ -9,6 +9,6 @@ import java.util.List; @interface TB { } @lombok.Builder(setterPrefix = "with") -class BuilderTypeAnnos { +class BuilderTypeAnnosWithSetterPrefix { private @TA @TB List foo; } diff --git a/test/transform/resource/before/BuilderValueDataWithSetterPrefix.java b/test/transform/resource/before/BuilderValueDataWithSetterPrefix.java index e5d9dc92..530c24d2 100644 --- a/test/transform/resource/before/BuilderValueDataWithSetterPrefix.java +++ b/test/transform/resource/before/BuilderValueDataWithSetterPrefix.java @@ -1,11 +1,11 @@ import java.util.List; -@lombok.Builder @lombok.Value -class BuilderAndValue { +@lombok.Builder(setterPrefix = "with") @lombok.Value +class BuilderAndValueWithSetterPrefix { private final int zero = 0; } @lombok.Builder(setterPrefix = "with") @lombok.Data -class BuilderAndData { +class BuilderAndDataWithSetterPrefix { private final int zero = 0; } diff --git a/test/transform/resource/before/BuilderWithAccessorsWithSetterPrefix.java b/test/transform/resource/before/BuilderWithAccessorsWithSetterPrefix.java index b14527a1..4f4ebb18 100644 --- a/test/transform/resource/before/BuilderWithAccessorsWithSetterPrefix.java +++ b/test/transform/resource/before/BuilderWithAccessorsWithSetterPrefix.java @@ -1,5 +1,5 @@ @lombok.Builder(setterPrefix = "with") @lombok.experimental.Accessors(prefix={"p", "_"}) -class BuilderWithAccessors { +class BuilderWithAccessorsWithSetterPrefix { private final int plower; private final int pUpper; private int _foo; diff --git a/test/transform/resource/before/BuilderWithBadNamesWithSetterPrefix.java b/test/transform/resource/before/BuilderWithBadNamesWithSetterPrefix.java index da344f76..69322ee3 100644 --- a/test/transform/resource/before/BuilderWithBadNamesWithSetterPrefix.java +++ b/test/transform/resource/before/BuilderWithBadNamesWithSetterPrefix.java @@ -1,5 +1,5 @@ @lombok.Builder(setterPrefix = "with") -public class BuilderWithBadNames { +public class BuilderWithBadNamesWithSetterPrefix { String build; String toString; } diff --git a/test/transform/resource/before/BuilderWithDeprecatedWithSetterPrefix.java b/test/transform/resource/before/BuilderWithDeprecatedWithSetterPrefix.java index 5047de45..77baccd3 100644 --- a/test/transform/resource/before/BuilderWithDeprecatedWithSetterPrefix.java +++ b/test/transform/resource/before/BuilderWithDeprecatedWithSetterPrefix.java @@ -3,7 +3,7 @@ import lombok.Builder; import lombok.Singular; @Builder(setterPrefix = "with") -public class BuilderWithDeprecated { +public class BuilderWithDeprecatedWithSetterPrefix { /** @deprecated since always */ String dep1; @Deprecated int dep2; @Singular @Deprecated java.util.List strings; diff --git a/test/transform/resource/before/BuilderWithExistingBuilderClassWithSetterPrefix.java b/test/transform/resource/before/BuilderWithExistingBuilderClassWithSetterPrefix.java index f931d507..cb699295 100644 --- a/test/transform/resource/before/BuilderWithExistingBuilderClassWithSetterPrefix.java +++ b/test/transform/resource/before/BuilderWithExistingBuilderClassWithSetterPrefix.java @@ -1,12 +1,12 @@ import lombok.Builder; -class BuilderWithExistingBuilderClass { +class BuilderWithExistingBuilderClassWithSetterPrefix { @Builder(setterPrefix = "with") - public static BuilderWithExistingBuilderClass staticMethod(Z arg1, boolean arg2, String arg3) { + public static BuilderWithExistingBuilderClassWithSetterPrefix staticMethod(Z arg1, boolean arg2, String arg3) { return null; } - public static class BuilderWithExistingBuilderClassBuilder { + public static class BuilderWithExistingBuilderClassBuilderWithSetterPrefix { private Z arg1; public void withArg2(boolean arg) { diff --git a/test/transform/resource/before/BuilderWithNoBuilderMethodWithSetterPrefix.java b/test/transform/resource/before/BuilderWithNoBuilderMethodWithSetterPrefix.java index fa8b8f09..b787e303 100644 --- a/test/transform/resource/before/BuilderWithNoBuilderMethodWithSetterPrefix.java +++ b/test/transform/resource/before/BuilderWithNoBuilderMethodWithSetterPrefix.java @@ -1,5 +1,5 @@ import lombok.Builder(setterPrefix = "with"); @Builder(toBuilder = true, builderMethodName = "", setterPrefix = "with") -class BuilderWithNoBuilderMethod { +class BuilderWithNoBuilderMethodWithSetterPrefix { private String a = ""; } diff --git a/test/transform/resource/before/BuilderWithNonNullWithSetterPrefix.java b/test/transform/resource/before/BuilderWithNonNullWithSetterPrefix.java index 1a18fbc7..8ef1f70e 100644 --- a/test/transform/resource/before/BuilderWithNonNullWithSetterPrefix.java +++ b/test/transform/resource/before/BuilderWithNonNullWithSetterPrefix.java @@ -1,5 +1,5 @@ @lombok.Builder(setterPrefix = "with") -class BuilderWithNonNull { +class BuilderWithNonNullWithSetterPrefix { @lombok.NonNull private final String id; } diff --git a/test/transform/resource/before/BuilderWithRecursiveGenericsWithSetterPrefix.java b/test/transform/resource/before/BuilderWithRecursiveGenericsWithSetterPrefix.java index 85129223..ce8803c0 100644 --- a/test/transform/resource/before/BuilderWithRecursiveGenericsWithSetterPrefix.java +++ b/test/transform/resource/before/BuilderWithRecursiveGenericsWithSetterPrefix.java @@ -3,7 +3,7 @@ import java.util.Set; import lombok.Builder; import lombok.Value; -public class BuilderWithRecursiveGenerics { +public class BuilderWithRecursiveGenericsWithSetterPrefix { interface Inter> {} @Builder(setterPrefix = "with") @Value public static class Test, Quz extends Inter> { diff --git a/test/transform/resource/before/BuilderWithToBuilderWithSetterPrefix.java b/test/transform/resource/before/BuilderWithToBuilderWithSetterPrefix.java index 8be20f58..b33211e9 100644 --- a/test/transform/resource/before/BuilderWithToBuilderWithSetterPrefix.java +++ b/test/transform/resource/before/BuilderWithToBuilderWithSetterPrefix.java @@ -1,7 +1,7 @@ import java.util.List; import lombok.Builder; @Builder(toBuilder = true, setterPrefix = "with") @lombok.experimental.Accessors(prefix = "m") -class BuilderWithToBuilder { +class BuilderWithToBuilderWithSetterPrefix { private String mOne, mTwo; @Builder.ObtainVia(method = "rrr", isStatic = true) private T foo; @lombok.Singular private List bars; @@ -10,11 +10,11 @@ class BuilderWithToBuilder { } } @lombok.experimental.Accessors(prefix = "m") -class ConstructorWithToBuilder { +class ConstructorWithToBuilderWithSetterPrefix { private String mOne, mTwo; private T foo; @lombok.Singular private com.google.common.collect.ImmutableList bars; - @Builder(toBuilder = true) + @Builder(toBuilder = true, setterPrefix = "with") public ConstructorWithToBuilder(String mOne, @Builder.ObtainVia(field = "foo") T baz, com.google.common.collect.ImmutableList bars) { } } diff --git a/test/transform/resource/before/BuilderWithTolerateWithSetterPrefix.java b/test/transform/resource/before/BuilderWithTolerateWithSetterPrefix.java index 2f4db558..fa7c0298 100644 --- a/test/transform/resource/before/BuilderWithTolerateWithSetterPrefix.java +++ b/test/transform/resource/before/BuilderWithTolerateWithSetterPrefix.java @@ -2,16 +2,16 @@ import lombok.Builder; import lombok.experimental.Tolerate; @Builder(setterPrefix = "with") -public class BuilderWithTolerate { +public class BuilderWithTolerateWithSetterPrefix { private final int value; public static void main(String[] args) { - BuilderWithTolerate.builder().value("42").build(); + BuilderWithTolerateWithSetterPrefix.builder().withValue("42").build(); } - public static class BuilderWithTolerateBuilder { + public static class BuilderWithTolerateWithSetterPrefixBuilder { @Tolerate - public BuilderWithTolerateBuilder value(String s) { + public BuilderWithTolerateWithSetterPrefixBuilder withValue(String s) { return this.value(Integer.parseInt(s)); } } -- cgit From ffb299730e8f378748c4594988ec568812bf895b Mon Sep 17 00:00:00 2001 From: Caleb Brinkman Date: Thu, 19 Sep 2019 16:05:17 -0500 Subject: Fix more broken tests --- .../BuilderSingularMapsWithSetterPrefix.java | 6 +++--- ...ularWildcardListsWithToBuilderWithSetterPrefix.java | 1 + .../BuilderWithAccessorsWithSetterPrefix.java | 2 +- ...uilderWithExistingBuilderClassWithSetterPrefix.java | 4 ++-- .../BuilderWithNoBuilderMethodWithSetterPrefix.java | 1 + .../BuilderWithToBuilderWithSetterPrefix.java | 1 + .../after-ecj/BuilderSimpleWithSetterPrefix.java | 4 ++-- ...ilderSingularToBuilderWithNullWithSetterPrefix.java | 2 +- ...ularWildcardListsWithToBuilderWithSetterPrefix.java | 2 +- .../BuilderSingularWithPrefixesWithSetterPrefix.java | 18 +++++++++--------- .../after-ecj/BuilderValueDataWithSetterPrefix.java | 2 +- .../BuilderWithAccessorsWithSetterPrefix.java | 2 +- ...uilderWithExistingBuilderClassWithSetterPrefix.java | 2 +- ...uilderWithExistingBuilderClassWithSetterPrefix.java | 2 +- .../BuilderWithNoBuilderMethodWithSetterPrefix.java | 4 ++-- ...BuilderSingularNoAutoWithSetterPrefix.java.messages | 2 ++ 16 files changed, 30 insertions(+), 25 deletions(-) create mode 100644 test/transform/resource/messages-ecj/BuilderSingularNoAutoWithSetterPrefix.java.messages (limited to 'test/transform/resource/before/BuilderWithExistingBuilderClassWithSetterPrefix.java') diff --git a/test/transform/resource/after-delombok/BuilderSingularMapsWithSetterPrefix.java b/test/transform/resource/after-delombok/BuilderSingularMapsWithSetterPrefix.java index 352a0723..a4afb8a8 100644 --- a/test/transform/resource/after-delombok/BuilderSingularMapsWithSetterPrefix.java +++ b/test/transform/resource/after-delombok/BuilderSingularMapsWithSetterPrefix.java @@ -95,7 +95,7 @@ class BuilderSingularMapsWithSetterPrefix { return this; } @SuppressWarnings("all") - public BuilderSingularMapsWithSetterPrefixBuilder withRawMan(Object rawMapKey, Object rawMapValue) { + public BuilderSingularMapsWithSetterPrefixBuilder withRawMap(Object rawMapKey, Object rawMapValue) { if (this.rawMap$key == null) { this.rawMap$key = new java.util.ArrayList(); this.rawMap$value = new java.util.ArrayList(); @@ -125,7 +125,7 @@ class BuilderSingularMapsWithSetterPrefix { return this; } @SuppressWarnings("all") - public BuilderSingularMapsWithSetterPrefixBuilder stringMap(String stringMapKey, V stringMapValue) { + public BuilderSingularMapsWithSetterPrefixBuilder withStringMap(String stringMapKey, V stringMapValue) { if (this.stringMap$key == null) { this.stringMap$key = new java.util.ArrayList(); this.stringMap$value = new java.util.ArrayList(); @@ -135,7 +135,7 @@ class BuilderSingularMapsWithSetterPrefix { return this; } @SuppressWarnings("all") - public BuilderSingularMapsWithSetterPrefixBuilder stringMap(java.util.Map stringMap) { + public BuilderSingularMapsWithSetterPrefixBuilder withStringMap(java.util.Map stringMap) { if (this.stringMap$key == null) { this.stringMap$key = new java.util.ArrayList(); this.stringMap$value = new java.util.ArrayList(); diff --git a/test/transform/resource/after-delombok/BuilderSingularWildcardListsWithToBuilderWithSetterPrefix.java b/test/transform/resource/after-delombok/BuilderSingularWildcardListsWithToBuilderWithSetterPrefix.java index 367f0ac1..8e849f44 100644 --- a/test/transform/resource/after-delombok/BuilderSingularWildcardListsWithToBuilderWithSetterPrefix.java +++ b/test/transform/resource/after-delombok/BuilderSingularWildcardListsWithToBuilderWithSetterPrefix.java @@ -1,5 +1,6 @@ import java.util.List; import java.util.Collection; +@Builder(toBuilder = true, setterPrefix = "with") class BuilderSingularWildcardListsWithToBuilderWithSetterPrefix { private List objects; private Collection numbers; diff --git a/test/transform/resource/after-delombok/BuilderWithAccessorsWithSetterPrefix.java b/test/transform/resource/after-delombok/BuilderWithAccessorsWithSetterPrefix.java index be581c47..45a79fdc 100644 --- a/test/transform/resource/after-delombok/BuilderWithAccessorsWithSetterPrefix.java +++ b/test/transform/resource/after-delombok/BuilderWithAccessorsWithSetterPrefix.java @@ -39,7 +39,7 @@ class BuilderWithAccessorsWithSetterPrefix { return this; } @java.lang.SuppressWarnings("all") - public BuilderWithAccessorsWithSetterPrefixBuilder with_Bar(final int _bar) { + public BuilderWithAccessorsWithSetterPrefixBuilder with_bar(final int _bar) { this._bar = _bar; return this; } diff --git a/test/transform/resource/after-delombok/BuilderWithExistingBuilderClassWithSetterPrefix.java b/test/transform/resource/after-delombok/BuilderWithExistingBuilderClassWithSetterPrefix.java index 95f89c9d..9b7b0c95 100644 --- a/test/transform/resource/after-delombok/BuilderWithExistingBuilderClassWithSetterPrefix.java +++ b/test/transform/resource/after-delombok/BuilderWithExistingBuilderClassWithSetterPrefix.java @@ -2,7 +2,7 @@ class BuilderWithExistingBuilderClassWithSetterPrefix { public static BuilderWithExistingBuilderClassWithSetterPrefix staticMethod(Z arg1, boolean arg2, String arg3) { return null; } - public static class BuilderWithExistingBuilderClassWithSetterPrefixBuilder { + public static class BuilderWithExistingBuilderClassBuilderWithSetterPrefixBuilder { @java.lang.SuppressWarnings("all") private boolean arg2; @java.lang.SuppressWarnings("all") @@ -11,7 +11,7 @@ class BuilderWithExistingBuilderClassWithSetterPrefix { public void withArg2(boolean arg) { } @java.lang.SuppressWarnings("all") - BuilderWithExistingBuilderClassWithSetterPrefixBuilder() { + BuilderWithExistingBuilderClassBuilderWithSetterPrefixBuilder() { } @java.lang.SuppressWarnings("all") public BuilderWithExistingBuilderClassWithSetterPrefixBuilder withArg1(final Z arg1) { diff --git a/test/transform/resource/after-delombok/BuilderWithNoBuilderMethodWithSetterPrefix.java b/test/transform/resource/after-delombok/BuilderWithNoBuilderMethodWithSetterPrefix.java index 0f478ed1..2381dcbe 100644 --- a/test/transform/resource/after-delombok/BuilderWithNoBuilderMethodWithSetterPrefix.java +++ b/test/transform/resource/after-delombok/BuilderWithNoBuilderMethodWithSetterPrefix.java @@ -1,3 +1,4 @@ +import lombok.Builder class BuilderWithNoBuilderMethodWithSetterPrefix { private String a = ""; @java.lang.SuppressWarnings("all") diff --git a/test/transform/resource/after-delombok/BuilderWithToBuilderWithSetterPrefix.java b/test/transform/resource/after-delombok/BuilderWithToBuilderWithSetterPrefix.java index 322c667c..091aed4d 100644 --- a/test/transform/resource/after-delombok/BuilderWithToBuilderWithSetterPrefix.java +++ b/test/transform/resource/after-delombok/BuilderWithToBuilderWithSetterPrefix.java @@ -1,4 +1,5 @@ import java.util.List; +import lombok.Builder; class BuilderWithToBuilderWithSetterPrefix { private String mOne; private String mTwo; diff --git a/test/transform/resource/after-ecj/BuilderSimpleWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderSimpleWithSetterPrefix.java index ad3485c6..110774e2 100644 --- a/test/transform/resource/after-ecj/BuilderSimpleWithSetterPrefix.java +++ b/test/transform/resource/after-ecj/BuilderSimpleWithSetterPrefix.java @@ -1,8 +1,8 @@ import java.util.List; @lombok.Builder(access = lombok.AccessLevel.PROTECTED,setterPrefix = "with") class BuilderSimpleWithSetterPrefix { - protected static @java.lang.SuppressWarnings("all") class BuilderSimpleWithSetterPrefix { + protected static @java.lang.SuppressWarnings("all") class BuilderSimpleWithSetterPrefixBuilder { private @java.lang.SuppressWarnings("all") int unprefixed; - @java.lang.SuppressWarnings("all") BuilderWithPrefixBuilder() { + @java.lang.SuppressWarnings("all") BuilderSimpleWithSetterPrefixBuilder() { super(); } public @java.lang.SuppressWarnings("all") BuilderWithPrefixBuilder withUnprefixed(final int unprefixed) { diff --git a/test/transform/resource/after-ecj/BuilderSingularToBuilderWithNullWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderSingularToBuilderWithNullWithSetterPrefix.java index 8728867d..ef2d02a1 100644 --- a/test/transform/resource/after-ecj/BuilderSingularToBuilderWithNullWithSetterPrefix.java +++ b/test/transform/resource/after-ecj/BuilderSingularToBuilderWithNullWithSetterPrefix.java @@ -1,5 +1,5 @@ import lombok.Singular; -@lombok.Builder(toBuilder = true, setterPrefix = "with") class BuilderSingularToBuilderWithNullWithSetterPrefix { +@lombok.Builder(toBuilder = true,setterPrefix = "with") class BuilderSingularToBuilderWithNullWithSetterPrefix { public static @java.lang.SuppressWarnings("all") class BuilderSingularToBuilderWithNullWithSetterPrefixBuilder { private @java.lang.SuppressWarnings("all") java.util.ArrayList elems; @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNullWithSetterPrefixBuilder() { diff --git a/test/transform/resource/after-ecj/BuilderSingularWildcardListsWithToBuilderWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderSingularWildcardListsWithToBuilderWithSetterPrefix.java index fe451d78..bbb10087 100644 --- a/test/transform/resource/after-ecj/BuilderSingularWildcardListsWithToBuilderWithSetterPrefix.java +++ b/test/transform/resource/after-ecj/BuilderSingularWildcardListsWithToBuilderWithSetterPrefix.java @@ -1,7 +1,7 @@ import java.util.List; import java.util.Collection; import lombok.Singular; -@lombok.Builder(toBuilder = true, setterPrefix = "with") class BuilderSingularWildcardListsWithToBuilderWithSetterPrefix { +@lombok.Builder(toBuilder = true,setterPrefix = "with") class BuilderSingularWildcardListsWithToBuilderWithSetterPrefix { public static @java.lang.SuppressWarnings("all") class BuilderSingularWildcardListsWithToBuilderWithSetterPrefixBuilder { private @java.lang.SuppressWarnings("all") java.util.ArrayList objects; private @java.lang.SuppressWarnings("all") java.util.ArrayList numbers; diff --git a/test/transform/resource/after-ecj/BuilderSingularWithPrefixesWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderSingularWithPrefixesWithSetterPrefix.java index 88f64f34..920803cc 100644 --- a/test/transform/resource/after-ecj/BuilderSingularWithPrefixesWithSetterPrefix.java +++ b/test/transform/resource/after-ecj/BuilderSingularWithPrefixesWithSetterPrefix.java @@ -1,23 +1,23 @@ import lombok.Singular; -@lombok.Builder(setterPrefix = "with") @lombok.experimental.Accessors(prefix = "_") class BuilderSingularWithPrefixesWithSetterPrefixes { - public static @java.lang.SuppressWarnings("all") class BuilderSingularWithPrefixesWithSetterPrefixesBuilder { +@lombok.Builder(setterPrefix = "with") @lombok.experimental.Accessors(prefix = "_") class BuilderSingularWithPrefixesWithSetterPrefix { + public static @java.lang.SuppressWarnings("all") class BuilderSingularWithPrefixesWithSetterPrefixBuilder { private @java.lang.SuppressWarnings("all") java.util.ArrayList elems; - @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesWithSetterPrefixesBuilder() { + @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesWithSetterPrefixBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesWithSetterPrefixesBuilder withElem(final String elem) { + public @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesWithSetterPrefixBuilder withElem(final String elem) { if ((this.elems == null)) this.elems = new java.util.ArrayList(); this.elems.add(elem); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesWithSetterPrefixesBuilder withElems(final java.util.Collection elems) { + public @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesWithSetterPrefixBuilder withElems(final java.util.Collection elems) { if ((this.elems == null)) this.elems = new java.util.ArrayList(); this.elems.addAll(elems); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesWithSetterPrefixesBuilder clearElems() { + public @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesWithSetterPrefixBuilder clearElems() { if ((this.elems != null)) this.elems.clear(); return this; @@ -37,7 +37,7 @@ import lombok.Singular; return new BuilderSingularWithPrefixesWithSetterPrefixes(elems); } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return (("BuilderSingularWithPrefixesWithSetterPrefixes.BuilderSingularWithPrefixesWithSetterPrefixesBuilder(elems=" + this.elems) + ")"); + return (("BuilderSingularWithPrefixesWithSetterPrefixes.BuilderSingularWithPrefixesWithSetterPrefixBuilder(elems=" + this.elems) + ")"); } } private @Singular java.util.List _elems; @@ -45,7 +45,7 @@ import lombok.Singular; super(); this._elems = elems; } - public static @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesWithSetterPrefixesBuilder builder() { - return new BuilderSingularWithPrefixesWithSetterPrefixesBuilder(); + public static @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesWithSetterPrefixBuilder builder() { + return new BuilderSingularWithPrefixesWithSetterPrefixBuilder(); } } diff --git a/test/transform/resource/after-ecj/BuilderValueDataWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderValueDataWithSetterPrefix.java index 679591a4..065c93fe 100644 --- a/test/transform/resource/after-ecj/BuilderValueDataWithSetterPrefix.java +++ b/test/transform/resource/after-ecj/BuilderValueDataWithSetterPrefix.java @@ -41,7 +41,7 @@ final @lombok.Builder(setterPrefix = "with") @lombok.Value class BuilderAndValue return (("BuilderAndValueWithSetterPrefix(zero=" + this.getZero()) + ")"); } } -@lombok.Builder @lombok.Data class BuilderAndDataWithSetterPrefix { +@lombok.Builder(setterPrefix = "with") @lombok.Data class BuilderAndDataWithSetterPrefix { public static @java.lang.SuppressWarnings("all") class BuilderAndDataWithSetterPrefixBuilder { @java.lang.SuppressWarnings("all") BuilderAndDataWithSetterPrefixBuilder() { super(); diff --git a/test/transform/resource/after-ecj/BuilderWithAccessorsWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderWithAccessorsWithSetterPrefix.java index 5894a4a2..d9c10e5b 100644 --- a/test/transform/resource/after-ecj/BuilderWithAccessorsWithSetterPrefix.java +++ b/test/transform/resource/after-ecj/BuilderWithAccessorsWithSetterPrefix.java @@ -19,7 +19,7 @@ this.foo = foo; return this; } - public @java.lang.SuppressWarnings("all") BuilderWithAccessorsWithSetterPrefixBuilder with_Bar(final int _bar) { + public @java.lang.SuppressWarnings("all") BuilderWithAccessorsWithSetterPrefixBuilder with_bar(final int _bar) { this._bar = _bar; return this; } diff --git a/test/transform/resource/after-ecj/BuilderWithExistingBuilderClassWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderWithExistingBuilderClassWithSetterPrefix.java index 8da2f012..b14c120f 100644 --- a/test/transform/resource/after-ecj/BuilderWithExistingBuilderClassWithSetterPrefix.java +++ b/test/transform/resource/after-ecj/BuilderWithExistingBuilderClassWithSetterPrefix.java @@ -1,6 +1,6 @@ import lombok.Builder; class BuilderWithExistingBuilderClassWithSetterPrefix { - public static class BuilderWithExistingBuilderClassWithSetterPrefixBuilder { + public static class BuilderWithExistingBuilderClassBuilderWithSetterPrefixBuilder { private @java.lang.SuppressWarnings("all") boolean arg2; private @java.lang.SuppressWarnings("all") String arg3; private Z arg1; diff --git a/test/transform/resource/before/BuilderWithExistingBuilderClassWithSetterPrefix.java b/test/transform/resource/before/BuilderWithExistingBuilderClassWithSetterPrefix.java index cb699295..99c3ccc6 100644 --- a/test/transform/resource/before/BuilderWithExistingBuilderClassWithSetterPrefix.java +++ b/test/transform/resource/before/BuilderWithExistingBuilderClassWithSetterPrefix.java @@ -6,7 +6,7 @@ class BuilderWithExistingBuilderClassWithSetterPrefix { return null; } - public static class BuilderWithExistingBuilderClassBuilderWithSetterPrefix { + public static class BuilderWithExistingBuilderClassBuilderWithSetterPrefixBuilder { private Z arg1; public void withArg2(boolean arg) { diff --git a/test/transform/resource/before/BuilderWithNoBuilderMethodWithSetterPrefix.java b/test/transform/resource/before/BuilderWithNoBuilderMethodWithSetterPrefix.java index b787e303..6fddd748 100644 --- a/test/transform/resource/before/BuilderWithNoBuilderMethodWithSetterPrefix.java +++ b/test/transform/resource/before/BuilderWithNoBuilderMethodWithSetterPrefix.java @@ -1,5 +1,5 @@ -import lombok.Builder(setterPrefix = "with"); -@Builder(toBuilder = true, builderMethodName = "", setterPrefix = "with") +import lombok.Builder +@Builder(toBuilder = true, builderMethodName = "",setterPrefix = "with") class BuilderWithNoBuilderMethodWithSetterPrefix { private String a = ""; } diff --git a/test/transform/resource/messages-ecj/BuilderSingularNoAutoWithSetterPrefix.java.messages b/test/transform/resource/messages-ecj/BuilderSingularNoAutoWithSetterPrefix.java.messages new file mode 100644 index 00000000..8719789b --- /dev/null +++ b/test/transform/resource/messages-ecj/BuilderSingularNoAutoWithSetterPrefix.java.messages @@ -0,0 +1,2 @@ +8 The singular must be specified explicitly (e.g. @Singular("task")) because auto singularization is disabled. +10 The singular must be specified explicitly (e.g. @Singular("task")) because auto singularization is disabled. -- cgit From 65302bc13a1ab670dac552e2214989c7381f71a8 Mon Sep 17 00:00:00 2001 From: Caleb Brinkman Date: Mon, 28 Oct 2019 12:09:15 -0500 Subject: More test fixes --- src/core/lombok/eclipse/handlers/HandleBuilder.java | 12 ++++++------ .../BuilderWithExistingBuilderClassWithSetterPrefix.java | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'test/transform/resource/before/BuilderWithExistingBuilderClassWithSetterPrefix.java') diff --git a/src/core/lombok/eclipse/handlers/HandleBuilder.java b/src/core/lombok/eclipse/handlers/HandleBuilder.java index 017cde17..70b07fb8 100755 --- a/src/core/lombok/eclipse/handlers/HandleBuilder.java +++ b/src/core/lombok/eclipse/handlers/HandleBuilder.java @@ -931,12 +931,6 @@ public class HandleBuilder extends EclipseAnnotationHandler { FieldDeclaration fd = (FieldDeclaration) fieldNode.get(); char[] name = fd.name; - for (int i = 0; i < len; i++) { - if (!(existing[i] instanceof MethodDeclaration)) continue; - char[] existingName = existing[i].selector; - if (Arrays.equals(name, existingName) && !isTolerate(fieldNode, existing[i])) return; - } - String setterPrefix = prefix.isEmpty() ? "set" : prefix; String setterName; if(fluent) { @@ -945,6 +939,12 @@ public class HandleBuilder extends EclipseAnnotationHandler { setterName = HandlerUtil.buildAccessorName(setterPrefix, new String(paramName)); } + for (int i = 0; i < len; i++) { + if (!(existing[i] instanceof MethodDeclaration)) continue; + char[] existingName = existing[i].selector; + if (Arrays.equals(setterName.toCharArray(), existingName) && !isTolerate(fieldNode, existing[i])) return; + } + List methodAnnsList = Collections.emptyList(); Annotation[] methodAnns = EclipseHandlerUtil.findCopyableToSetterAnnotations(originalFieldNode); if (methodAnns != null && methodAnns.length > 0) methodAnnsList = Arrays.asList(methodAnns); diff --git a/test/transform/resource/before/BuilderWithExistingBuilderClassWithSetterPrefix.java b/test/transform/resource/before/BuilderWithExistingBuilderClassWithSetterPrefix.java index 99c3ccc6..e30dd1ff 100644 --- a/test/transform/resource/before/BuilderWithExistingBuilderClassWithSetterPrefix.java +++ b/test/transform/resource/before/BuilderWithExistingBuilderClassWithSetterPrefix.java @@ -6,7 +6,7 @@ class BuilderWithExistingBuilderClassWithSetterPrefix { return null; } - public static class BuilderWithExistingBuilderClassBuilderWithSetterPrefixBuilder { + public static class BuilderWithExistingBuilderClassWithSetterPrefixBuilder { private Z arg1; public void withArg2(boolean arg) { -- cgit