diff options
Diffstat (limited to 'test')
72 files changed, 781 insertions, 113 deletions
diff --git a/test/pretty/resource/after/Cast.java b/test/pretty/resource/after/Cast.java index 95237b0f..e32150c3 100644 --- a/test/pretty/resource/after/Cast.java +++ b/test/pretty/resource/after/Cast.java @@ -1,6 +1,6 @@ import java.util.*; public class Cast { public void test(List<?> list) { - RandomAccess r = (/*before*/ RandomAccess /*after*/)list; + RandomAccess r = (/*before*/ RandomAccess /*after*/) list; } }
\ No newline at end of file diff --git a/test/pretty/resource/after/CastWithIntersection.java b/test/pretty/resource/after/CastWithIntersection.java index 2eebdee1..dc0904f6 100644 --- a/test/pretty/resource/after/CastWithIntersection.java +++ b/test/pretty/resource/after/CastWithIntersection.java @@ -1,6 +1,6 @@ import java.util.*; public class CastWithIntersection { public void test(List<?> list) { - RandomAccess r = (RandomAccess & java.io.Serializable)list; + RandomAccess r = (RandomAccess & java.io.Serializable) list; } }
\ No newline at end of file diff --git a/test/pretty/resource/after/DefaultMethod.java b/test/pretty/resource/after/DefaultMethod.java index 864ba60f..fe9594b8 100644 --- a/test/pretty/resource/after/DefaultMethod.java +++ b/test/pretty/resource/after/DefaultMethod.java @@ -3,6 +3,6 @@ interface DefaultMethod { default boolean isEmpty() { return size() == 0; } - default strictfp void run() { + strictfp default void run() { } }
\ No newline at end of file diff --git a/test/pretty/resource/after/Enum.java b/test/pretty/resource/after/Enum.java index dd738b5b..a3b2b643 100644 --- a/test/pretty/resource/after/Enum.java +++ b/test/pretty/resource/after/Enum.java @@ -1,13 +1,8 @@ enum Ranks { - CLUBS, - HEARTS, - DIAMONDS, - SPADES; + CLUBS, HEARTS, DIAMONDS, SPADES; } enum Complex { - RED("ff0000"), - GREEN("00ff00"), - BLUE("0000f"); + RED("ff0000"), GREEN("00ff00"), BLUE("0000f"); private final String webColour; Complex(String webColour) { this.webColour = webColour; diff --git a/test/pretty/resource/after/ExoticJava.java b/test/pretty/resource/after/ExoticJava.java new file mode 100644 index 00000000..fb9a9131 --- /dev/null +++ b/test/pretty/resource/after/ExoticJava.java @@ -0,0 +1,46 @@ +import static java.lang.String.*; +import java.io.*; +class ExoticJava<V> { + public <T> ExoticJava(T genericsInConstructor, V genericsInType) { + System.out.println(new <String>ExoticJava<Integer>("Hello", 5)); + } + public void test() { + int x = 5; + int[] y = {10}; + ; + class MethodLocal implements Serializable, java.util.RandomAccess { + @SuppressWarnings({"unchecked", "rawtypes"}) + public final strictfp int foo() { + int x = super.hashCode(); + x <<= 5; + do { + x <<= 5; + } while (Boolean.FALSE); + return x; + } + } + for (int i = 10, j[] = {20}; i < 5; i++, j[0]++) { + String z = ""; + try ( + PrintWriter pw = new PrintWriter(System.out); + PrintWriter p2 = new PrintWriter(System.out)) { + pw.println(); + } finally { + synchronized (z) { + System.out.println(z); + } + } + if ((y == null)) { + } + if (((y == null))) ; + { + ; + } + java.util.List<String> list = new java.util.ArrayList<>(); + assert Boolean.TRUE : "That\'s weird"; + double d = -1.8E12; + long loooong = 305441741; + int octal = 87; + } + } +}
\ No newline at end of file diff --git a/test/pretty/resource/after/Interfaces.java b/test/pretty/resource/after/Interfaces.java index 6c0a6770..f7f386c0 100644 --- a/test/pretty/resource/after/Interfaces.java +++ b/test/pretty/resource/after/Interfaces.java @@ -1,10 +1,7 @@ @SuppressWarnings("all") interface Interfaces { enum Ranks { - CLUBS, - HEARTS, - DIAMONDS, - SPADES; + CLUBS, HEARTS, DIAMONDS, SPADES; } int x = 10; void y(); diff --git a/test/pretty/resource/before/Cast.java b/test/pretty/resource/before/Cast.java index 95237b0f..e32150c3 100644 --- a/test/pretty/resource/before/Cast.java +++ b/test/pretty/resource/before/Cast.java @@ -1,6 +1,6 @@ import java.util.*; public class Cast { public void test(List<?> list) { - RandomAccess r = (/*before*/ RandomAccess /*after*/)list; + RandomAccess r = (/*before*/ RandomAccess /*after*/) list; } }
\ No newline at end of file diff --git a/test/pretty/resource/before/ExoticJava.java b/test/pretty/resource/before/ExoticJava.java new file mode 100644 index 00000000..b70b1e12 --- /dev/null +++ b/test/pretty/resource/before/ExoticJava.java @@ -0,0 +1,45 @@ +import static java.lang.String.*; + +import java.io.*; + +class ExoticJava<V> { + public <T> ExoticJava(T genericsInConstructor, V genericsInType) { + System.out.println(new <String>ExoticJava<Integer>("Hello", 5)); + } + ;;;; + public void test() { + int x = 5, y[] = {10}; + ; + class MethodLocal implements Serializable, java.util.RandomAccess { + @SuppressWarnings({"unchecked", "rawtypes"}) + strictfp public final int foo() { + int x = super.hashCode(); + x <<= 5; + do { + x <<= 5; + } while (Boolean.FALSE); + return x; + } + } + + for (int i = 10, j[] = {20}; i < 5; i++, j[0]++) { + String z = ""; + try (PrintWriter pw = new PrintWriter(System.out); PrintWriter p2 = new PrintWriter(System.out)) { + pw.println(); + } finally { + synchronized (z) { + System.out.println(z); + } + } + + if ((y == null)) {} + if (((y == null))) ; + {;} + java.util.List<String> list = new java.util.ArrayList<>(); + assert Boolean.TRUE : "That's weird"; + double d = -1.8e12; + long loooong = 0x1234ABCD; + int octal = 0127; + } + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/Accessors.java b/test/transform/resource/after-delombok/Accessors.java index 3f4698e0..a04ea171 100644 --- a/test/transform/resource/after-delombok/Accessors.java +++ b/test/transform/resource/after-delombok/Accessors.java @@ -81,8 +81,8 @@ class AccessorsPrefix3 { public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof AccessorsPrefix3)) return false; - final AccessorsPrefix3 other = (AccessorsPrefix3)o; - if (!other.canEqual((java.lang.Object)this)) return false; + final AccessorsPrefix3 other = (AccessorsPrefix3) o; + if (!other.canEqual((java.lang.Object) this)) return false; final java.lang.Object this$fName = this.getName(); final java.lang.Object other$fName = other.getName(); if (this$fName == null ? other$fName != null : !this$fName.equals(other$fName)) return false; diff --git a/test/transform/resource/after-delombok/BuilderInstanceMethod.java b/test/transform/resource/after-delombok/BuilderInstanceMethod.java new file mode 100644 index 00000000..61e237d0 --- /dev/null +++ b/test/transform/resource/after-delombok/BuilderInstanceMethod.java @@ -0,0 +1,66 @@ +import java.util.List; +class BuilderInstanceMethod<T> { + public String create(int show, final int yes, List<T> also, int $andMe) { + return "" + show + yes + also + $andMe; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public class StringBuilder { + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + private int show; + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + private int yes; + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + private List<T> also; + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + private int $andMe; + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + StringBuilder() { + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public StringBuilder show(final int show) { + this.show = show; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public StringBuilder yes(final int yes) { + this.yes = yes; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public StringBuilder also(final List<T> also) { + this.also = also; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public StringBuilder $andMe(final int $andMe) { + this.$andMe = $andMe; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public String build() { + return BuilderInstanceMethod.this.create(show, yes, also, $andMe); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public java.lang.String toString() { + return "BuilderInstanceMethod.StringBuilder(show=" + this.show + ", yes=" + this.yes + ", also=" + this.also + ", $andMe=" + this.$andMe + ")"; + } + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public StringBuilder builder() { + return new StringBuilder(); + } +} diff --git a/test/transform/resource/after-delombok/BuilderSingularGuavaListsSets.java b/test/transform/resource/after-delombok/BuilderSingularGuavaListsSets.java index f676166d..7f1e7149 100644 --- a/test/transform/resource/after-delombok/BuilderSingularGuavaListsSets.java +++ b/test/transform/resource/after-delombok/BuilderSingularGuavaListsSets.java @@ -57,6 +57,12 @@ class BuilderSingularGuavaListsSets<T> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularGuavaListsSetsBuilder<T> clearCards() { + this.cards = null; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularGuavaListsSetsBuilder<T> frog(final Number frog) { if (this.frogs == null) this.frogs = com.google.common.collect.ImmutableList.builder(); this.frogs.add(frog); @@ -71,6 +77,12 @@ class BuilderSingularGuavaListsSets<T> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularGuavaListsSetsBuilder<T> clearFrogs() { + this.frogs = null; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularGuavaListsSetsBuilder<T> rawSet(final java.lang.Object rawSet) { if (this.rawSet == null) this.rawSet = com.google.common.collect.ImmutableSet.builder(); this.rawSet.add(rawSet); @@ -85,6 +97,12 @@ class BuilderSingularGuavaListsSets<T> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularGuavaListsSetsBuilder<T> clearRawSet() { + this.rawSet = null; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularGuavaListsSetsBuilder<T> pass(final String pass) { if (this.passes == null) this.passes = com.google.common.collect.ImmutableSortedSet.naturalOrder(); this.passes.add(pass); @@ -99,6 +117,9 @@ class BuilderSingularGuavaListsSets<T> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularGuavaListsSetsBuilder<T> clearPasses() { + this.passes = null; + } public BuilderSingularGuavaListsSetsBuilder<T> user(final com.google.common.collect.Table.Cell<Number, Number, String> user) { if (this.users == null) this.users = com.google.common.collect.ImmutableTable.builder(); this.users.put(user); diff --git a/test/transform/resource/after-delombok/BuilderSingularGuavaMaps.java b/test/transform/resource/after-delombok/BuilderSingularGuavaMaps.java index 0cb0001b..10545a8f 100644 --- a/test/transform/resource/after-delombok/BuilderSingularGuavaMaps.java +++ b/test/transform/resource/after-delombok/BuilderSingularGuavaMaps.java @@ -45,6 +45,12 @@ class BuilderSingularGuavaMaps<K, V> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularGuavaMapsBuilder<K, V> clearBattleaxes() { + this.battleaxes = null; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularGuavaMapsBuilder<K, V> vertex(final Integer vertex$key, final V vertex$value) { if (this.vertices == null) this.vertices = com.google.common.collect.ImmutableSortedMap.naturalOrder(); this.vertices.put(vertex$key, vertex$value); @@ -59,6 +65,12 @@ class BuilderSingularGuavaMaps<K, V> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularGuavaMapsBuilder<K, V> clearVertices() { + this.vertices = null; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularGuavaMapsBuilder<K, V> rawMap(final java.lang.Object rawMap$key, final java.lang.Object rawMap$value) { if (this.rawMap == null) this.rawMap = com.google.common.collect.ImmutableBiMap.builder(); this.rawMap.put(rawMap$key, rawMap$value); @@ -73,6 +85,12 @@ class BuilderSingularGuavaMaps<K, V> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularGuavaMapsBuilder<K, V> clearRawMap() { + this.rawMap = null; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularGuavaMaps<K, V> build() { com.google.common.collect.ImmutableMap<K, V> battleaxes = this.battleaxes == null ? com.google.common.collect.ImmutableMap.<K, V>of() : this.battleaxes.build(); com.google.common.collect.ImmutableSortedMap<Integer, V> vertices = this.vertices == null ? com.google.common.collect.ImmutableSortedMap.<Integer, V>of() : this.vertices.build(); diff --git a/test/transform/resource/after-delombok/BuilderSingularLists.java b/test/transform/resource/after-delombok/BuilderSingularLists.java index f58934d4..9b409404 100644 --- a/test/transform/resource/after-delombok/BuilderSingularLists.java +++ b/test/transform/resource/after-delombok/BuilderSingularLists.java @@ -44,6 +44,12 @@ class BuilderSingularLists<T> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularListsBuilder<T> clearChildren() { + if (this.children != null) this.children.clear(); + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularListsBuilder<T> scarf(final Number scarf) { if (this.scarves == null) this.scarves = new java.util.ArrayList<Number>(); this.scarves.add(scarf); @@ -58,6 +64,12 @@ class BuilderSingularLists<T> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularListsBuilder<T> clearScarves() { + if (this.scarves != null) this.scarves.clear(); + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public 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); @@ -72,6 +84,12 @@ class BuilderSingularLists<T> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularListsBuilder<T> clearRawList() { + if (this.rawList != null) this.rawList.clear(); + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularLists<T> build() { java.util.List<T> children; switch (this.children == null ? 0 : this.children.size()) { diff --git a/test/transform/resource/after-delombok/BuilderSingularMaps.java b/test/transform/resource/after-delombok/BuilderSingularMaps.java index 212ece26..257a2ec2 100644 --- a/test/transform/resource/after-delombok/BuilderSingularMaps.java +++ b/test/transform/resource/after-delombok/BuilderSingularMaps.java @@ -57,6 +57,14 @@ class BuilderSingularMaps<K, V> { return this; } @SuppressWarnings("all") + public BuilderSingularMapsBuilder<K, V> clearWomen() { + if (this.women$key != null) { + this.women$key.clear(); + this.women$value.clear(); + } + return this; + } + @SuppressWarnings("all") public BuilderSingularMapsBuilder<K, V> man(K manKey, Number manValue) { if (this.men$key == null) { this.men$key = new java.util.ArrayList<K>(); @@ -79,6 +87,14 @@ class BuilderSingularMaps<K, V> { return this; } @SuppressWarnings("all") + public BuilderSingularMapsBuilder<K, V> clearMen() { + if (this.men$key != null) { + this.men$key.clear(); + this.men$value.clear(); + } + return this; + } + @SuppressWarnings("all") public BuilderSingularMapsBuilder<K, V> rawMap(Object rawMapKey, Object rawMapValue) { if (this.rawMap$key == null) { this.rawMap$key = new java.util.ArrayList<Object>(); @@ -101,6 +117,14 @@ class BuilderSingularMaps<K, V> { return this; } @SuppressWarnings("all") + public BuilderSingularMapsBuilder<K, V> clearRawMap() { + if (this.rawMap$key != null) { + this.rawMap$key.clear(); + this.rawMap$value.clear(); + } + return this; + } + @SuppressWarnings("all") public BuilderSingularMapsBuilder<K, V> stringMap(String stringMapKey, V stringMapValue) { if (this.stringMap$key == null) { this.stringMap$key = new java.util.ArrayList<String>(); @@ -123,6 +147,14 @@ class BuilderSingularMaps<K, V> { return this; } @SuppressWarnings("all") + public BuilderSingularMapsBuilder<K, V> clearStringMap() { + if (this.stringMap$key != null) { + this.stringMap$key.clear(); + this.stringMap$value.clear(); + } + return this; + } + @SuppressWarnings("all") public BuilderSingularMaps<K, V> build() { java.util.Map<K, V> women; switch (this.women$key == null ? 0 : this.women$key.size()) { diff --git a/test/transform/resource/after-delombok/BuilderSingularNoAuto.java b/test/transform/resource/after-delombok/BuilderSingularNoAuto.java index 0be33a84..d5cd8f41 100644 --- a/test/transform/resource/after-delombok/BuilderSingularNoAuto.java +++ b/test/transform/resource/after-delombok/BuilderSingularNoAuto.java @@ -42,6 +42,12 @@ class BuilderSingularNoAuto { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularNoAutoBuilder clearThings() { + if (this.things != null) this.things.clear(); + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularNoAutoBuilder widget(final String widget) { if (this.widgets == null) this.widgets = new java.util.ArrayList<String>(); this.widgets.add(widget); @@ -56,6 +62,12 @@ class BuilderSingularNoAuto { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularNoAutoBuilder clearWidgets() { + if (this.widgets != null) this.widgets.clear(); + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularNoAutoBuilder items(final String items) { if (this.items == null) this.items = new java.util.ArrayList<String>(); this.items.add(items); @@ -70,6 +82,12 @@ class BuilderSingularNoAuto { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularNoAutoBuilder clearItems() { + if (this.items != null) this.items.clear(); + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularNoAuto build() { java.util.List<String> things; switch (this.things == null ? 0 : this.things.size()) { diff --git a/test/transform/resource/after-delombok/BuilderSingularRedirectToGuava.java b/test/transform/resource/after-delombok/BuilderSingularRedirectToGuava.java index 0dd40c9f..506a8b4c 100644 --- a/test/transform/resource/after-delombok/BuilderSingularRedirectToGuava.java +++ b/test/transform/resource/after-delombok/BuilderSingularRedirectToGuava.java @@ -44,6 +44,12 @@ class BuilderSingularRedirectToGuava { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularRedirectToGuavaBuilder clearDangerMice() { + this.dangerMice = null; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularRedirectToGuavaBuilder thing(final Integer thing$key, final Number thing$value) { if (this.things == null) this.things = com.google.common.collect.ImmutableSortedMap.naturalOrder(); this.things.put(thing$key, thing$value); @@ -58,6 +64,12 @@ class BuilderSingularRedirectToGuava { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularRedirectToGuavaBuilder clearThings() { + this.things = null; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularRedirectToGuavaBuilder doohickey(final Class<?> doohickey) { if (this.doohickeys == null) this.doohickeys = com.google.common.collect.ImmutableList.builder(); this.doohickeys.add(doohickey); @@ -72,6 +84,12 @@ class BuilderSingularRedirectToGuava { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularRedirectToGuavaBuilder clearDoohickeys() { + this.doohickeys = null; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularRedirectToGuava build() { java.util.Set<String> dangerMice = this.dangerMice == null ? com.google.common.collect.ImmutableSet.<String>of() : this.dangerMice.build(); java.util.NavigableMap<Integer, Number> things = this.things == null ? com.google.common.collect.ImmutableSortedMap.<Integer, Number>of() : this.things.build(); diff --git a/test/transform/resource/after-delombok/BuilderSingularSets.java b/test/transform/resource/after-delombok/BuilderSingularSets.java index 70372b99..c794726a 100644 --- a/test/transform/resource/after-delombok/BuilderSingularSets.java +++ b/test/transform/resource/after-delombok/BuilderSingularSets.java @@ -49,6 +49,12 @@ class BuilderSingularSets<T> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularSetsBuilder<T> clearDangerMice() { + if (this.dangerMice != null) this.dangerMice.clear(); + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularSetsBuilder<T> octopus(final Number octopus) { if (this.octopodes == null) this.octopodes = new java.util.ArrayList<Number>(); this.octopodes.add(octopus); @@ -63,6 +69,12 @@ class BuilderSingularSets<T> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularSetsBuilder<T> clearOctopodes() { + if (this.octopodes != null) this.octopodes.clear(); + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public 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); @@ -77,6 +89,12 @@ class BuilderSingularSets<T> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularSetsBuilder<T> clearRawSet() { + if (this.rawSet != null) this.rawSet.clear(); + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularSetsBuilder<T> stringSet(final String stringSet) { if (this.stringSet == null) this.stringSet = new java.util.ArrayList<String>(); this.stringSet.add(stringSet); @@ -91,6 +109,12 @@ class BuilderSingularSets<T> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularSetsBuilder<T> clearStringSet() { + if (this.stringSet != null) this.stringSet.clear(); + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularSets<T> build() { java.util.Set<T> dangerMice; switch (this.dangerMice == null ? 0 : this.dangerMice.size()) { diff --git a/test/transform/resource/after-delombok/BuilderWithToBuilder.java b/test/transform/resource/after-delombok/BuilderWithToBuilder.java index eb61a6db..7dfb046a 100644 --- a/test/transform/resource/after-delombok/BuilderWithToBuilder.java +++ b/test/transform/resource/after-delombok/BuilderWithToBuilder.java @@ -68,6 +68,12 @@ class BuilderWithToBuilder<T> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderWithToBuilderBuilder<T> clearBars() { + if (this.bars != null) this.bars.clear(); + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderWithToBuilder<T> build() { java.util.List<T> bars; switch (this.bars == null ? 0 : this.bars.size()) { diff --git a/test/transform/resource/after-delombok/ConflictingStaticConstructorNames.java b/test/transform/resource/after-delombok/ConflictingStaticConstructorNames.java index a47fa244..ff5278ff 100644 --- a/test/transform/resource/after-delombok/ConflictingStaticConstructorNames.java +++ b/test/transform/resource/after-delombok/ConflictingStaticConstructorNames.java @@ -5,8 +5,8 @@ class ConflictingStaticConstructorNames { public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof ConflictingStaticConstructorNames)) return false; - final ConflictingStaticConstructorNames other = (ConflictingStaticConstructorNames)o; - if (!other.canEqual((java.lang.Object)this)) return false; + final ConflictingStaticConstructorNames other = (ConflictingStaticConstructorNames) o; + if (!other.canEqual((java.lang.Object) this)) return false; return true; } @java.lang.SuppressWarnings("all") diff --git a/test/transform/resource/after-delombok/DataConfiguration.java b/test/transform/resource/after-delombok/DataConfiguration.java index b83204b8..aadb35b6 100644 --- a/test/transform/resource/after-delombok/DataConfiguration.java +++ b/test/transform/resource/after-delombok/DataConfiguration.java @@ -16,8 +16,8 @@ class DataConfiguration { public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof DataConfiguration)) return false; - final DataConfiguration other = (DataConfiguration)o; - if (!other.canEqual((java.lang.Object)this)) return false; + final DataConfiguration other = (DataConfiguration) o; + if (!other.canEqual((java.lang.Object) this)) return false; if (this.getX() != other.getX()) return false; return true; } diff --git a/test/transform/resource/after-delombok/DataExtended.java b/test/transform/resource/after-delombok/DataExtended.java index 25180429..175738ad 100644 --- a/test/transform/resource/after-delombok/DataExtended.java +++ b/test/transform/resource/after-delombok/DataExtended.java @@ -20,8 +20,8 @@ class DataExtended { public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof DataExtended)) return false; - final DataExtended other = (DataExtended)o; - if (!other.canEqual((java.lang.Object)this)) return false; + final DataExtended other = (DataExtended) o; + if (!other.canEqual((java.lang.Object) this)) return false; if (this.getX() != other.getX()) return false; return true; } diff --git a/test/transform/resource/after-delombok/DataIgnore.java b/test/transform/resource/after-delombok/DataIgnore.java index 0d40a5a8..d5a3d81e 100644 --- a/test/transform/resource/after-delombok/DataIgnore.java +++ b/test/transform/resource/after-delombok/DataIgnore.java @@ -18,8 +18,8 @@ class DataIgnore { public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof DataIgnore)) return false; - final DataIgnore other = (DataIgnore)o; - if (!other.canEqual((java.lang.Object)this)) return false; + final DataIgnore other = (DataIgnore) o; + if (!other.canEqual((java.lang.Object) this)) return false; if (this.getX() != other.getX()) return false; return true; } diff --git a/test/transform/resource/after-delombok/DataOnLocalClass.java b/test/transform/resource/after-delombok/DataOnLocalClass.java index 44b069fd..0e15ab4c 100644 --- a/test/transform/resource/after-delombok/DataOnLocalClass.java +++ b/test/transform/resource/after-delombok/DataOnLocalClass.java @@ -29,8 +29,8 @@ class DataOnLocalClass1 { public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof Local)) return false; - final Local other = (Local)o; - if (!other.canEqual((java.lang.Object)this)) return false; + final Local other = (Local) o; + if (!other.canEqual((java.lang.Object) this)) return false; if (this.getX() != other.getX()) return false; final java.lang.Object this$name = this.getName(); final java.lang.Object other$name = other.getName(); @@ -97,8 +97,8 @@ class DataOnLocalClass2 { public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof Local.InnerLocal)) return false; - final InnerLocal other = (InnerLocal)o; - if (!other.canEqual((java.lang.Object)this)) return false; + final InnerLocal other = (InnerLocal) o; + if (!other.canEqual((java.lang.Object) this)) return false; final java.lang.Object this$name = this.getName(); final java.lang.Object other$name = other.getName(); if (this$name == null ? other$name != null : !this$name.equals(other$name)) return false; @@ -142,8 +142,8 @@ class DataOnLocalClass2 { public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof Local)) return false; - final Local other = (Local)o; - if (!other.canEqual((java.lang.Object)this)) return false; + final Local other = (Local) o; + if (!other.canEqual((java.lang.Object) this)) return false; if (this.getX() != other.getX()) return false; return true; } diff --git a/test/transform/resource/after-delombok/DataPlain.java b/test/transform/resource/after-delombok/DataPlain.java index cfb72656..ccebc55e 100644 --- a/test/transform/resource/after-delombok/DataPlain.java +++ b/test/transform/resource/after-delombok/DataPlain.java @@ -28,8 +28,8 @@ class Data1 { public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof Data1)) return false; - final Data1 other = (Data1)o; - if (!other.canEqual((java.lang.Object)this)) return false; + final Data1 other = (Data1) o; + if (!other.canEqual((java.lang.Object) this)) return false; if (this.getX() != other.getX()) return false; final java.lang.Object this$name = this.getName(); final java.lang.Object other$name = other.getName(); @@ -89,8 +89,8 @@ class Data2 { public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof Data2)) return false; - final Data2 other = (Data2)o; - if (!other.canEqual((java.lang.Object)this)) return false; + final Data2 other = (Data2) o; + if (!other.canEqual((java.lang.Object) this)) return false; if (this.getX() != other.getX()) return false; final java.lang.Object this$name = this.getName(); final java.lang.Object other$name = other.getName(); @@ -150,7 +150,7 @@ final class Data3 { public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof Data3)) return false; - final Data3 other = (Data3)o; + final Data3 other = (Data3) o; if (this.getX() != other.getX()) return false; final java.lang.Object this$name = this.getName(); final java.lang.Object other$name = other.getName(); @@ -201,8 +201,8 @@ final class Data4 extends java.util.Timer { public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof Data4)) return false; - final Data4 other = (Data4)o; - if (!other.canEqual((java.lang.Object)this)) return false; + final Data4 other = (Data4) o; + if (!other.canEqual((java.lang.Object) this)) return false; if (!super.equals(o)) return false; if (this.getX() != other.getX()) return false; return true; @@ -234,8 +234,8 @@ class Data5 { public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof Data5)) return false; - final Data5 other = (Data5)o; - if (!other.canEqual((java.lang.Object)this)) return false; + final Data5 other = (Data5) o; + if (!other.canEqual((java.lang.Object) this)) return false; return true; } @java.lang.SuppressWarnings("all") diff --git a/test/transform/resource/after-delombok/DataWithGetter.java b/test/transform/resource/after-delombok/DataWithGetter.java index f849e0f8..fb51e262 100644 --- a/test/transform/resource/after-delombok/DataWithGetter.java +++ b/test/transform/resource/after-delombok/DataWithGetter.java @@ -24,8 +24,8 @@ class DataWithGetter { public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof DataWithGetter)) return false; - final DataWithGetter other = (DataWithGetter)o; - if (!other.canEqual((java.lang.Object)this)) return false; + final DataWithGetter other = (DataWithGetter) o; + if (!other.canEqual((java.lang.Object) this)) return false; if (this.getX() != other.getX()) return false; if (this.getY() != other.getY()) return false; final java.lang.Object this$z = this.getZ(); diff --git a/test/transform/resource/after-delombok/DataWithGetterNone.java b/test/transform/resource/after-delombok/DataWithGetterNone.java index c46be723..e332db02 100644 --- a/test/transform/resource/after-delombok/DataWithGetterNone.java +++ b/test/transform/resource/after-delombok/DataWithGetterNone.java @@ -24,8 +24,8 @@ class DataWithGetterNone { public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof DataWithGetterNone)) return false; - final DataWithGetterNone other = (DataWithGetterNone)o; - if (!other.canEqual((java.lang.Object)this)) return false; + final DataWithGetterNone other = (DataWithGetterNone) o; + if (!other.canEqual((java.lang.Object) this)) return false; if (this.x != other.x) return false; if (this.y != other.y) return false; final java.lang.Object this$z = this.z; diff --git a/test/transform/resource/after-delombok/DelegateOnGetter.java b/test/transform/resource/after-delombok/DelegateOnGetter.java index 5b5090e9..1d25dcc0 100644 --- a/test/transform/resource/after-delombok/DelegateOnGetter.java +++ b/test/transform/resource/after-delombok/DelegateOnGetter.java @@ -12,7 +12,7 @@ class DelegateOnGetter { synchronized (this.bar) { value = this.bar.get(); if (value == null) { - final Bar actualValue = new Bar(){ + final Bar actualValue = new Bar() { public void setList(java.util.ArrayList<String> list) { } public int getInt() { @@ -24,7 +24,7 @@ class DelegateOnGetter { } } } - return (Bar)(value == this.bar ? null : value); + return (Bar) (value == this.bar ? null : value); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") diff --git a/test/transform/resource/after-delombok/EqualsAndHashCode.java b/test/transform/resource/after-delombok/EqualsAndHashCode.java index d0ed4067..7ade594a 100644 --- a/test/transform/resource/after-delombok/EqualsAndHashCode.java +++ b/test/transform/resource/after-delombok/EqualsAndHashCode.java @@ -10,8 +10,8 @@ class EqualsAndHashCode { public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof EqualsAndHashCode)) return false; - final EqualsAndHashCode other = (EqualsAndHashCode)o; - if (!other.canEqual((java.lang.Object)this)) return false; + final EqualsAndHashCode other = (EqualsAndHashCode) o; + if (!other.canEqual((java.lang.Object) this)) return false; if (this.x != other.x) return false; if (!java.util.Arrays.equals(this.y, other.y)) return false; if (!java.util.Arrays.deepEquals(this.z, other.z)) return false; @@ -56,7 +56,7 @@ final class EqualsAndHashCode2 { public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof EqualsAndHashCode2)) return false; - final EqualsAndHashCode2 other = (EqualsAndHashCode2)o; + final EqualsAndHashCode2 other = (EqualsAndHashCode2) o; if (this.x != other.x) return false; if (this.y != other.y) return false; if (java.lang.Float.compare(this.f, other.f) != 0) return false; @@ -72,10 +72,10 @@ final class EqualsAndHashCode2 { int result = 1; result = result * PRIME + this.x; final long $y = this.y; - result = result * PRIME + (int)($y >>> 32 ^ $y); + result = result * PRIME + (int) ($y >>> 32 ^ $y); result = result * PRIME + java.lang.Float.floatToIntBits(this.f); final long $d = java.lang.Double.doubleToLongBits(this.d); - result = result * PRIME + (int)($d >>> 32 ^ $d); + result = result * PRIME + (int) ($d >>> 32 ^ $d); result = result * PRIME + (this.b ? 79 : 97); return result; } @@ -87,8 +87,8 @@ final class EqualsAndHashCode3 extends EqualsAndHashCode { public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof EqualsAndHashCode3)) return false; - final EqualsAndHashCode3 other = (EqualsAndHashCode3)o; - if (!other.canEqual((java.lang.Object)this)) return false; + final EqualsAndHashCode3 other = (EqualsAndHashCode3) o; + if (!other.canEqual((java.lang.Object) this)) return false; return true; } @java.lang.SuppressWarnings("all") @@ -111,8 +111,8 @@ class EqualsAndHashCode4 extends EqualsAndHashCode { public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof EqualsAndHashCode4)) return false; - final EqualsAndHashCode4 other = (EqualsAndHashCode4)o; - if (!other.canEqual((java.lang.Object)this)) return false; + final EqualsAndHashCode4 other = (EqualsAndHashCode4) o; + if (!other.canEqual((java.lang.Object) this)) return false; if (!super.equals(o)) return false; return true; } diff --git a/test/transform/resource/after-delombok/EqualsAndHashCodeWithExistingMethods.java b/test/transform/resource/after-delombok/EqualsAndHashCodeWithExistingMethods.java index 5c9316b4..6978bf00 100644 --- a/test/transform/resource/after-delombok/EqualsAndHashCodeWithExistingMethods.java +++ b/test/transform/resource/after-delombok/EqualsAndHashCodeWithExistingMethods.java @@ -21,8 +21,8 @@ final class EqualsAndHashCodeWithExistingMethods3 extends EqualsAndHashCodeWithE public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof EqualsAndHashCodeWithExistingMethods3)) return false; - final EqualsAndHashCodeWithExistingMethods3 other = (EqualsAndHashCodeWithExistingMethods3)o; - if (!other.canEqual((java.lang.Object)this)) return false; + final EqualsAndHashCodeWithExistingMethods3 other = (EqualsAndHashCodeWithExistingMethods3) o; + if (!other.canEqual((java.lang.Object) this)) return false; if (!super.equals(o)) return false; if (this.x != other.x) return false; return true; diff --git a/test/transform/resource/after-delombok/EqualsAndHashCodeWithOnParam.java b/test/transform/resource/after-delombok/EqualsAndHashCodeWithOnParam.java index 69b69d29..4cf00601 100644 --- a/test/transform/resource/after-delombok/EqualsAndHashCodeWithOnParam.java +++ b/test/transform/resource/after-delombok/EqualsAndHashCodeWithOnParam.java @@ -13,8 +13,8 @@ class EqualsAndHashCodeWithOnParam { public boolean equals(@Nullable final java.lang.Object o) { if (o == this) return true; if (!(o instanceof EqualsAndHashCodeWithOnParam)) return false; - final EqualsAndHashCodeWithOnParam other = (EqualsAndHashCodeWithOnParam)o; - if (!other.canEqual((java.lang.Object)this)) return false; + final EqualsAndHashCodeWithOnParam other = (EqualsAndHashCodeWithOnParam) o; + if (!other.canEqual((java.lang.Object) this)) return false; if (this.x != other.x) return false; if (!java.util.Arrays.equals(this.y, other.y)) return false; if (!java.util.Arrays.deepEquals(this.z, other.z)) return false; diff --git a/test/transform/resource/after-delombok/EqualsAndHashCodeWithSomeExistingMethods.java b/test/transform/resource/after-delombok/EqualsAndHashCodeWithSomeExistingMethods.java index 37eeb8df..b3a1fb0d 100644 --- a/test/transform/resource/after-delombok/EqualsAndHashCodeWithSomeExistingMethods.java +++ b/test/transform/resource/after-delombok/EqualsAndHashCodeWithSomeExistingMethods.java @@ -28,8 +28,8 @@ class EqualsAndHashCodeWithSomeExistingMethods2 { public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof EqualsAndHashCodeWithSomeExistingMethods2)) return false; - final EqualsAndHashCodeWithSomeExistingMethods2 other = (EqualsAndHashCodeWithSomeExistingMethods2)o; - if (!other.canEqual((java.lang.Object)this)) return false; + final EqualsAndHashCodeWithSomeExistingMethods2 other = (EqualsAndHashCodeWithSomeExistingMethods2) o; + if (!other.canEqual((java.lang.Object) this)) return false; if (this.x != other.x) return false; return true; } @@ -75,8 +75,8 @@ class EqualsAndHashCodeWithNoExistingMethods { public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof EqualsAndHashCodeWithNoExistingMethods)) return false; - final EqualsAndHashCodeWithNoExistingMethods other = (EqualsAndHashCodeWithNoExistingMethods)o; - if (!other.canEqual((java.lang.Object)this)) return false; + final EqualsAndHashCodeWithNoExistingMethods other = (EqualsAndHashCodeWithNoExistingMethods) o; + if (!other.canEqual((java.lang.Object) this)) return false; if (this.x != other.x) return false; return true; } diff --git a/test/transform/resource/after-delombok/EqualsAndHashcodeOfExclude.java b/test/transform/resource/after-delombok/EqualsAndHashcodeOfExclude.java new file mode 100644 index 00000000..2a75430f --- /dev/null +++ b/test/transform/resource/after-delombok/EqualsAndHashcodeOfExclude.java @@ -0,0 +1,46 @@ +final class EqualsAndHashCodeOf { + int x; + int y; + @java.lang.Override + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public boolean equals(final java.lang.Object o) { + if (o == this) return true; + if (!(o instanceof EqualsAndHashCodeOf)) return false; + final EqualsAndHashCodeOf other = (EqualsAndHashCodeOf) o; + if (this.x != other.x) return false; + return true; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public int hashCode() { + final int PRIME = 59; + int result = 1; + result = result * PRIME + this.x; + return result; + } +} +final class EqualsAndHashCodeExclude { + int x; + int y; + @java.lang.Override + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public boolean equals(final java.lang.Object o) { + if (o == this) return true; + if (!(o instanceof EqualsAndHashCodeExclude)) return false; + final EqualsAndHashCodeExclude other = (EqualsAndHashCodeExclude) o; + if (this.x != other.x) return false; + return true; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public int hashCode() { + final int PRIME = 59; + int result = 1; + result = result * PRIME + this.x; + return result; + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/FieldDefaultsViaConfig.java b/test/transform/resource/after-delombok/FieldDefaultsViaConfig.java new file mode 100644 index 00000000..096769b6 --- /dev/null +++ b/test/transform/resource/after-delombok/FieldDefaultsViaConfig.java @@ -0,0 +1,11 @@ +class FieldDefaultsViaConfig1 { + private final int x; + private int y; + FieldDefaultsViaConfig1(int x) { + this.x = x; + } +} +class FieldDefaultsViaConfig2 { + final int x = 2; + protected final int y = 0; +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/FieldDefaultsViaConfigAndRequiredArgsConstructor.java b/test/transform/resource/after-delombok/FieldDefaultsViaConfigAndRequiredArgsConstructor.java new file mode 100644 index 00000000..ebe6e2ed --- /dev/null +++ b/test/transform/resource/after-delombok/FieldDefaultsViaConfigAndRequiredArgsConstructor.java @@ -0,0 +1,9 @@ +class FieldDefaultsViaConfigAndRequiredArgsConstructor { + final int x; + @java.beans.ConstructorProperties({"x"}) + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public FieldDefaultsViaConfigAndRequiredArgsConstructor(final int x) { + this.x = x; + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/GetterLazy.java b/test/transform/resource/after-delombok/GetterLazy.java index 9c7db37b..2ea3cbf2 100644 --- a/test/transform/resource/after-delombok/GetterLazy.java +++ b/test/transform/resource/after-delombok/GetterLazy.java @@ -16,6 +16,6 @@ class GetterLazy { } } } - return (ValueType)(value == this.fieldName ? null : value); + return (ValueType) (value == this.fieldName ? null : value); } } diff --git a/test/transform/resource/after-delombok/GetterLazyBoolean.java b/test/transform/resource/after-delombok/GetterLazyBoolean.java index f9a42e66..41349447 100644 --- a/test/transform/resource/after-delombok/GetterLazyBoolean.java +++ b/test/transform/resource/after-delombok/GetterLazyBoolean.java @@ -10,8 +10,8 @@ class GetterLazyBoolean { public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof GetterLazyBoolean)) return false; - final GetterLazyBoolean other = (GetterLazyBoolean)o; - if (!other.canEqual((java.lang.Object)this)) return false; + final GetterLazyBoolean other = (GetterLazyBoolean) o; + if (!other.canEqual((java.lang.Object) this)) return false; if (this.isBooleanValue() != other.isBooleanValue()) return false; return true; } @@ -49,7 +49,7 @@ class GetterLazyBoolean { } } } - return (java.lang.Boolean)value; + return (java.lang.Boolean) value; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @@ -65,6 +65,6 @@ class GetterLazyBoolean { } } } - return (java.lang.Boolean)value; + return (java.lang.Boolean) value; } } diff --git a/test/transform/resource/after-delombok/GetterLazyEahcToString.java b/test/transform/resource/after-delombok/GetterLazyEahcToString.java index db075cde..973eb6f1 100644 --- a/test/transform/resource/after-delombok/GetterLazyEahcToString.java +++ b/test/transform/resource/after-delombok/GetterLazyEahcToString.java @@ -9,8 +9,8 @@ class GetterLazyEahcToString { public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof GetterLazyEahcToString)) return false; - final GetterLazyEahcToString other = (GetterLazyEahcToString)o; - if (!other.canEqual((java.lang.Object)this)) return false; + final GetterLazyEahcToString other = (GetterLazyEahcToString) o; + if (!other.canEqual((java.lang.Object) this)) return false; final java.lang.Object this$value = this.getValue(); final java.lang.Object other$value = other.getValue(); if (this$value == null ? other$value != null : !this$value.equals(other$value)) return false; @@ -62,11 +62,10 @@ class GetterLazyEahcToString { } } } - return (String)(value == this.value ? null : value); + return (String) (value == this.value ? null : value); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getValue2() { return this.value2; diff --git a/test/transform/resource/after-delombok/GetterLazyNative.java b/test/transform/resource/after-delombok/GetterLazyNative.java index 50e3ff2b..0d88558d 100644 --- a/test/transform/resource/after-delombok/GetterLazyNative.java +++ b/test/transform/resource/after-delombok/GetterLazyNative.java @@ -22,7 +22,7 @@ class GetterLazyNative { } } } - return (java.lang.Boolean)value; + return (java.lang.Boolean) value; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @@ -38,7 +38,7 @@ class GetterLazyNative { } } } - return (java.lang.Byte)value; + return (java.lang.Byte) value; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @@ -54,7 +54,7 @@ class GetterLazyNative { } } } - return (java.lang.Short)value; + return (java.lang.Short) value; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @@ -70,7 +70,7 @@ class GetterLazyNative { } } } - return (java.lang.Integer)value; + return (java.lang.Integer) value; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @@ -86,7 +86,7 @@ class GetterLazyNative { } } } - return (java.lang.Long)value; + return (java.lang.Long) value; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @@ -102,7 +102,7 @@ class GetterLazyNative { } } } - return (java.lang.Float)value; + return (java.lang.Float) value; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @@ -118,7 +118,7 @@ class GetterLazyNative { } } } - return (java.lang.Double)value; + return (java.lang.Double) value; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @@ -134,7 +134,7 @@ class GetterLazyNative { } } } - return (java.lang.Character)value; + return (java.lang.Character) value; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @@ -144,12 +144,12 @@ class GetterLazyNative { synchronized (this.intArrayField) { value = this.intArrayField.get(); if (value == null) { - final int[] actualValue = new int[]{1}; + final int[] actualValue = new int[] {1}; value = actualValue == null ? this.intArrayField : actualValue; this.intArrayField.set(value); } } } - return (int[])(value == this.intArrayField ? null : value); + return (int[]) (value == this.intArrayField ? null : value); } } diff --git a/test/transform/resource/after-delombok/GetterSetterJavadoc.java b/test/transform/resource/after-delombok/GetterSetterJavadoc.java index 45a99c9d..f156de92 100644 --- a/test/transform/resource/after-delombok/GetterSetterJavadoc.java +++ b/test/transform/resource/after-delombok/GetterSetterJavadoc.java @@ -33,8 +33,8 @@ class GetterSetterJavadoc1 { public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof GetterSetterJavadoc1)) return false; - final GetterSetterJavadoc1 other = (GetterSetterJavadoc1)o; - if (!other.canEqual((java.lang.Object)this)) return false; + final GetterSetterJavadoc1 other = (GetterSetterJavadoc1) o; + if (!other.canEqual((java.lang.Object) this)) return false; if (this.getFieldName() != other.getFieldName()) return false; return true; } diff --git a/test/transform/resource/after-delombok/InjectField.java b/test/transform/resource/after-delombok/InjectField.java index 55390a60..8215f8d0 100644 --- a/test/transform/resource/after-delombok/InjectField.java +++ b/test/transform/resource/after-delombok/InjectField.java @@ -1,8 +1,7 @@ import java.util.logging.Level; enum InjectField1 { - A, - B; + A, B; @java.lang.SuppressWarnings("all") diff --git a/test/transform/resource/after-delombok/LoggerSlf4jTypes.java b/test/transform/resource/after-delombok/LoggerSlf4jTypes.java index e987d807..a4e13afc 100644 --- a/test/transform/resource/after-delombok/LoggerSlf4jTypes.java +++ b/test/transform/resource/after-delombok/LoggerSlf4jTypes.java @@ -3,7 +3,7 @@ interface LoggerSlf4jTypesInterface { @interface LoggerSlf4jTypesAnnotation { } enum LoggerSlf4jTypesEnum { -; + ; @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(LoggerSlf4jTypesEnum.class); diff --git a/test/transform/resource/after-delombok/NonNullOnParameterOfDefaultMethod.java b/test/transform/resource/after-delombok/NonNullOnParameterOfDefaultMethod.java new file mode 100644 index 00000000..e220296f --- /dev/null +++ b/test/transform/resource/after-delombok/NonNullOnParameterOfDefaultMethod.java @@ -0,0 +1,10 @@ +// version 8: +interface NonNullOnParameterOfDefaultMethod { + void test(@lombok.NonNull String arg); + default void test2(@lombok.NonNull String arg) { + if (arg == null) { + throw new java.lang.NullPointerException("arg"); + } + System.out.println(arg); + } +} diff --git a/test/transform/resource/after-delombok/UtilityClass.java b/test/transform/resource/after-delombok/UtilityClass.java index 7731b49c..6b3c1761 100644 --- a/test/transform/resource/after-delombok/UtilityClass.java +++ b/test/transform/resource/after-delombok/UtilityClass.java @@ -24,8 +24,7 @@ class UtilityInner { } } enum UtilityInsideEnum { - FOO, - BAR; + FOO, BAR; static final class InsideEnum { static int member; @java.lang.SuppressWarnings("all") diff --git a/test/transform/resource/after-delombok/UtilityClassErrors.java b/test/transform/resource/after-delombok/UtilityClassErrors.java index 9626461a..072edf91 100644 --- a/test/transform/resource/after-delombok/UtilityClassErrors.java +++ b/test/transform/resource/after-delombok/UtilityClassErrors.java @@ -8,7 +8,7 @@ final class UtilityClassErrors1 { } } enum UtilityClassErrors2 { -; + ; } class UtilityClassErrors3 { class NonStaticInner { diff --git a/test/transform/resource/after-delombok/ValAnonymousSubclassWithGenerics.java b/test/transform/resource/after-delombok/ValAnonymousSubclassWithGenerics.java index 25a9e0ce..07093e5a 100644 --- a/test/transform/resource/after-delombok/ValAnonymousSubclassWithGenerics.java +++ b/test/transform/resource/after-delombok/ValAnonymousSubclassWithGenerics.java @@ -1,6 +1,6 @@ import java.util.*; public class ValAnonymousSubclassWithGenerics { - Object object = new Object(){ + Object object = new Object() { void foo() { final int j = 1; } @@ -9,7 +9,7 @@ public class ValAnonymousSubclassWithGenerics { final int k = super.hashCode(); int x = k; } - java.util.List<String> names = new java.util.ArrayList<String>(){ + java.util.List<String> names = new java.util.ArrayList<String>() { public String get(int i) { final java.lang.String result = super.get(i); return result; diff --git a/test/transform/resource/after-delombok/ValLambda.java b/test/transform/resource/after-delombok/ValLambda.java index 0b13b5a1..40b056f3 100644 --- a/test/transform/resource/after-delombok/ValLambda.java +++ b/test/transform/resource/after-delombok/ValLambda.java @@ -1,21 +1,21 @@ // version 8: class ValLambda { public void easyLambda() { - final java.lang.Runnable foo = (Runnable)() -> { + final java.lang.Runnable foo = (Runnable) () -> { }; } public void easyIntersectionLambda() { - final java.lang.Object foo = (Runnable & java.io.Serializable)() -> { + final java.lang.Object foo = (Runnable & java.io.Serializable) () -> { }; - final java.lang.Object bar = (java.io.Serializable & Runnable)() -> { + final java.lang.Object bar = (java.io.Serializable & Runnable) () -> { }; } public void easyLubLambda() { - final java.lang.Runnable foo = (System.currentTimeMillis() > 0) ? (Runnable)() -> { - } : (Runnable)System.out::println; + final java.lang.Runnable foo = (System.currentTimeMillis() > 0) ? (Runnable) () -> { + } : (Runnable) System.out::println; } // public void castLubLambda() { -// Runnable foo = (Runnable)((System.currentTimeMillis() > 0) ? ()-> {} : System.out::println); -// lombok.val foo = (Runnable)((System.currentTimeMillis() > 0) ? ()-> {} : System.out::println); +// Runnable foo = (Runnable) ((System.currentTimeMillis() > 0) ? () -> {} : System.out::println); +// lombok.val foo = (Runnable) ((System.currentTimeMillis() > 0) ? () -> {} : System.out::println); // } }
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/ValRawType.java b/test/transform/resource/after-delombok/ValRawType.java index dc297046..122eabda 100644 --- a/test/transform/resource/after-delombok/ValRawType.java +++ b/test/transform/resource/after-delombok/ValRawType.java @@ -5,7 +5,7 @@ public class ValRawType { public void test() { Element propElement = new Element(); for (final java.lang.Object attribute : propElement.attributes()) { - final ValRawType.Attribute attr = (Attribute)attribute; + final ValRawType.Attribute attr = (Attribute) attribute; } } diff --git a/test/transform/resource/after-delombok/ValWeirdTypes.java b/test/transform/resource/after-delombok/ValWeirdTypes.java index 2c2905ed..996ce662 100644 --- a/test/transform/resource/after-delombok/ValWeirdTypes.java +++ b/test/transform/resource/after-delombok/ValWeirdTypes.java @@ -18,7 +18,7 @@ public class ValWeirdTypes<Z> { final long y = 5 + 3L; } public void testAnonymousInnerClass() { - final java.lang.Runnable y = new Runnable(){ + final java.lang.Runnable y = new Runnable() { public void run() { } }; @@ -48,8 +48,8 @@ public class ValWeirdTypes<Z> { final java.lang.Object nully = null; } public void testArrays() { - final int[] intArray = new int[]{1, 2, 3}; - final java.lang.Object[][] multiDimArray = new Object[][]{{}}; + final int[] intArray = new int[] {1, 2, 3}; + final java.lang.Object[][] multiDimArray = new Object[][] {{}}; final int[] copy = intArray; final java.lang.Object[] single = multiDimArray[0]; final int singleInt = copy[0]; diff --git a/test/transform/resource/after-delombok/ValWithLocalClasses.java b/test/transform/resource/after-delombok/ValWithLocalClasses.java index b739b10e..6487eb82 100644 --- a/test/transform/resource/after-delombok/ValWithLocalClasses.java +++ b/test/transform/resource/after-delombok/ValWithLocalClasses.java @@ -1,6 +1,6 @@ class ValWithLocalClasses1 { { - final ValWithLocalClasses2 f2 = new ValWithLocalClasses2(){ + final ValWithLocalClasses2 f2 = new ValWithLocalClasses2() { }; } } diff --git a/test/transform/resource/after-delombok/ValuePlain.java b/test/transform/resource/after-delombok/ValuePlain.java index 8cc19c1e..056cdacf 100644 --- a/test/transform/resource/after-delombok/ValuePlain.java +++ b/test/transform/resource/after-delombok/ValuePlain.java @@ -24,7 +24,7 @@ final class Value1 { public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof Value1)) return false; - final Value1 other = (Value1)o; + final Value1 other = (Value1) o; if (this.getX() != other.getX()) return false; final java.lang.Object this$name = this.getName(); final java.lang.Object other$name = other.getName(); @@ -75,8 +75,8 @@ class Value2 { public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof Value2)) return false; - final Value2 other = (Value2)o; - if (!other.canEqual((java.lang.Object)this)) return false; + final Value2 other = (Value2) o; + if (!other.canEqual((java.lang.Object) this)) return false; if (this.getX() != other.getX()) return false; final java.lang.Object this$name = this.getName(); final java.lang.Object other$name = other.getName(); @@ -132,7 +132,7 @@ final class Value3 { public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof Value3)) return false; - final Value3 other = (Value3)o; + final Value3 other = (Value3) o; if (this.getX() != other.getX()) return false; if (this.getY() != other.getY()) return false; return true; diff --git a/test/transform/resource/after-ecj/BuilderInstanceMethod.java b/test/transform/resource/after-ecj/BuilderInstanceMethod.java new file mode 100644 index 00000000..ff7d0aab --- /dev/null +++ b/test/transform/resource/after-ecj/BuilderInstanceMethod.java @@ -0,0 +1,43 @@ +import java.util.List; +class BuilderInstanceMethod<T> { + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") class StringBuilder { + private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int show; + private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int yes; + private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") List<T> also; + private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int $andMe; + @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") StringBuilder() { + super(); + } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") StringBuilder show(final int show) { + this.show = show; + return this; + } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") StringBuilder yes(final int yes) { + this.yes = yes; + return this; + } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") StringBuilder also(final List<T> also) { + this.also = also; + return this; + } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") StringBuilder $andMe(final int $andMe) { + this.$andMe = $andMe; + return this; + } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String build() { + return BuilderInstanceMethod.this.create(show, yes, also, $andMe); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + return (((((((("BuilderInstanceMethod.StringBuilder(show=" + this.show) + ", yes=") + this.yes) + ", also=") + this.also) + ", $andMe=") + this.$andMe) + ")"); + } + } + BuilderInstanceMethod() { + super(); + } + public @lombok.Builder String create(int show, final int yes, List<T> also, int $andMe) { + return (((("" + show) + yes) + also) + $andMe); + } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") StringBuilder builder() { + return new StringBuilder(); + } +} diff --git a/test/transform/resource/after-ecj/BuilderSingularGuavaListsSets.java b/test/transform/resource/after-ecj/BuilderSingularGuavaListsSets.java index dc53b8fb..28dc2fac 100644 --- a/test/transform/resource/after-ecj/BuilderSingularGuavaListsSets.java +++ b/test/transform/resource/after-ecj/BuilderSingularGuavaListsSets.java @@ -26,6 +26,10 @@ import lombok.Singular; this.cards.addAll(cards); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> clearCards() { + this.cards = null; + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> frog(Number frog) { if ((this.frogs == null)) this.frogs = com.google.common.collect.ImmutableList.builder(); @@ -38,6 +42,10 @@ import lombok.Singular; this.frogs.addAll(frogs); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> clearFrogs() { + this.frogs = null; + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> rawSet(java.lang.Object rawSet) { if ((this.rawSet == null)) this.rawSet = com.google.common.collect.ImmutableSet.builder(); @@ -50,6 +58,10 @@ import lombok.Singular; this.rawSet.addAll(rawSet); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> clearRawSet() { + this.rawSet = null; + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> pass(String pass) { if ((this.passes == null)) this.passes = com.google.common.collect.ImmutableSortedSet.naturalOrder(); @@ -62,6 +74,9 @@ import lombok.Singular; this.passes.addAll(passes); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> clearPasses() { + this.passes = null; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> user(com.google.common.collect.Table.Cell<Number, Number, String> user) { if ((this.users == null)) this.users = com.google.common.collect.ImmutableTable.builder(); diff --git a/test/transform/resource/after-ecj/BuilderSingularGuavaMaps.java b/test/transform/resource/after-ecj/BuilderSingularGuavaMaps.java index d4dfc18a..0a031f2a 100644 --- a/test/transform/resource/after-ecj/BuilderSingularGuavaMaps.java +++ b/test/transform/resource/after-ecj/BuilderSingularGuavaMaps.java @@ -22,6 +22,10 @@ import lombok.Singular; this.battleaxes.putAll(battleaxes); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMapsBuilder<K, V> clearBattleaxes() { + this.battleaxes = null; + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMapsBuilder<K, V> vertex(Integer vertex$key, V vertex$value) { if ((this.vertices == null)) this.vertices = com.google.common.collect.ImmutableSortedMap.naturalOrder(); @@ -34,6 +38,10 @@ import lombok.Singular; this.vertices.putAll(vertices); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMapsBuilder<K, V> clearVertices() { + this.vertices = null; + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMapsBuilder<K, V> rawMap(java.lang.Object rawMap$key, java.lang.Object rawMap$value) { if ((this.rawMap == null)) this.rawMap = com.google.common.collect.ImmutableBiMap.builder(); @@ -46,6 +54,10 @@ import lombok.Singular; this.rawMap.putAll(rawMap); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMapsBuilder<K, V> clearRawMap() { + this.rawMap = null; + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMaps<K, V> build() { com.google.common.collect.ImmutableMap<K, V> battleaxes = ((this.battleaxes == null) ? com.google.common.collect.ImmutableMap.<K, V>of() : this.battleaxes.build()); com.google.common.collect.ImmutableSortedMap<Integer, V> vertices = ((this.vertices == null) ? com.google.common.collect.ImmutableSortedMap.<Integer, V>of() : this.vertices.build()); diff --git a/test/transform/resource/after-ecj/BuilderSingularLists.java b/test/transform/resource/after-ecj/BuilderSingularLists.java index c66fcf1b..e1036262 100644 --- a/test/transform/resource/after-ecj/BuilderSingularLists.java +++ b/test/transform/resource/after-ecj/BuilderSingularLists.java @@ -22,6 +22,11 @@ import lombok.Singular; this.children.addAll(children); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularListsBuilder<T> clearChildren() { + if ((this.children != null)) + this.children.clear(); + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularListsBuilder<T> scarf(Number scarf) { if ((this.scarves == null)) this.scarves = new java.util.ArrayList<Number>(); @@ -34,6 +39,11 @@ import lombok.Singular; this.scarves.addAll(scarves); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularListsBuilder<T> clearScarves() { + if ((this.scarves != null)) + this.scarves.clear(); + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularListsBuilder<T> rawList(java.lang.Object rawList) { if ((this.rawList == null)) this.rawList = new java.util.ArrayList<java.lang.Object>(); @@ -46,6 +56,11 @@ import lombok.Singular; this.rawList.addAll(rawList); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularListsBuilder<T> clearRawList() { + if ((this.rawList != null)) + this.rawList.clear(); + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularLists<T> build() { java.util.List<T> children; switch (((this.children == null) ? 0 : this.children.size())) { diff --git a/test/transform/resource/after-ecj/BuilderSingularMaps.java b/test/transform/resource/after-ecj/BuilderSingularMaps.java index 8a2e14eb..38ac0ed7 100644 --- a/test/transform/resource/after-ecj/BuilderSingularMaps.java +++ b/test/transform/resource/after-ecj/BuilderSingularMaps.java @@ -37,6 +37,14 @@ import lombok.Singular; } return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMapsBuilder<K, V> clearWomen() { + if ((this.women$key != null)) + { + this.women$key.clear(); + this.women$value.clear(); + } + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMapsBuilder<K, V> man(K manKey, Number manValue) { if ((this.men$key == null)) { @@ -60,6 +68,14 @@ import lombok.Singular; } return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMapsBuilder<K, V> clearMen() { + if ((this.men$key != null)) + { + this.men$key.clear(); + this.men$value.clear(); + } + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMapsBuilder<K, V> rawMap(java.lang.Object rawMapKey, java.lang.Object rawMapValue) { if ((this.rawMap$key == null)) { @@ -83,6 +99,14 @@ import lombok.Singular; } return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMapsBuilder<K, V> clearRawMap() { + if ((this.rawMap$key != null)) + { + this.rawMap$key.clear(); + this.rawMap$value.clear(); + } + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMapsBuilder<K, V> stringMap(String stringMapKey, V stringMapValue) { if ((this.stringMap$key == null)) { @@ -106,6 +130,14 @@ import lombok.Singular; } return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMapsBuilder<K, V> clearStringMap() { + if ((this.stringMap$key != null)) + { + this.stringMap$key.clear(); + this.stringMap$value.clear(); + } + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMaps<K, V> build() { java.util.Map<K, V> women; switch (((this.women$key == null) ? 0 : this.women$key.size())) { diff --git a/test/transform/resource/after-ecj/BuilderSingularNoAuto.java b/test/transform/resource/after-ecj/BuilderSingularNoAuto.java index d5b06f1e..1b79538c 100644 --- a/test/transform/resource/after-ecj/BuilderSingularNoAuto.java +++ b/test/transform/resource/after-ecj/BuilderSingularNoAuto.java @@ -20,6 +20,11 @@ import lombok.Singular; this.things.addAll(things); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularNoAutoBuilder clearThings() { + if ((this.things != null)) + this.things.clear(); + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularNoAutoBuilder widget(String widget) { if ((this.widgets == null)) this.widgets = new java.util.ArrayList<String>(); @@ -32,6 +37,11 @@ import lombok.Singular; this.widgets.addAll(widgets); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularNoAutoBuilder clearWidgets() { + if ((this.widgets != null)) + this.widgets.clear(); + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularNoAutoBuilder items(String items) { if ((this.items == null)) this.items = new java.util.ArrayList<String>(); @@ -44,6 +54,11 @@ import lombok.Singular; this.items.addAll(items); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularNoAutoBuilder clearItems() { + if ((this.items != null)) + this.items.clear(); + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularNoAuto build() { java.util.List<String> things; switch (((this.things == null) ? 0 : this.things.size())) { diff --git a/test/transform/resource/after-ecj/BuilderSingularRedirectToGuava.java b/test/transform/resource/after-ecj/BuilderSingularRedirectToGuava.java index 6e18d8ee..02a915d2 100644 --- a/test/transform/resource/after-ecj/BuilderSingularRedirectToGuava.java +++ b/test/transform/resource/after-ecj/BuilderSingularRedirectToGuava.java @@ -22,6 +22,10 @@ import lombok.Singular; this.dangerMice.addAll(dangerMice); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularRedirectToGuavaBuilder clearDangerMice() { + this.dangerMice = null; + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularRedirectToGuavaBuilder thing(Integer thing$key, Number thing$value) { if ((this.things == null)) this.things = com.google.common.collect.ImmutableSortedMap.naturalOrder(); @@ -34,6 +38,10 @@ import lombok.Singular; this.things.putAll(things); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularRedirectToGuavaBuilder clearThings() { + this.things = null; + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularRedirectToGuavaBuilder doohickey(Class<?> doohickey) { if ((this.doohickeys == null)) this.doohickeys = com.google.common.collect.ImmutableList.builder(); @@ -46,6 +54,10 @@ import lombok.Singular; this.doohickeys.addAll(doohickeys); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularRedirectToGuavaBuilder clearDoohickeys() { + this.doohickeys = null; + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularRedirectToGuava build() { java.util.Set<String> dangerMice = ((this.dangerMice == null) ? com.google.common.collect.ImmutableSet.<String>of() : this.dangerMice.build()); java.util.NavigableMap<Integer, Number> things = ((this.things == null) ? com.google.common.collect.ImmutableSortedMap.<Integer, Number>of() : this.things.build()); diff --git a/test/transform/resource/after-ecj/BuilderSingularSets.java b/test/transform/resource/after-ecj/BuilderSingularSets.java index 819de534..118eb16f 100644 --- a/test/transform/resource/after-ecj/BuilderSingularSets.java +++ b/test/transform/resource/after-ecj/BuilderSingularSets.java @@ -22,6 +22,11 @@ import lombok.Singular; this.dangerMice.addAll(dangerMice); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSetsBuilder<T> clearDangerMice() { + if ((this.dangerMice != null)) + this.dangerMice.clear(); + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSetsBuilder<T> octopus(Number octopus) { if ((this.octopodes == null)) this.octopodes = new java.util.ArrayList<Number>(); @@ -34,6 +39,11 @@ import lombok.Singular; this.octopodes.addAll(octopodes); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSetsBuilder<T> clearOctopodes() { + if ((this.octopodes != null)) + this.octopodes.clear(); + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSetsBuilder<T> rawSet(java.lang.Object rawSet) { if ((this.rawSet == null)) this.rawSet = new java.util.ArrayList<java.lang.Object>(); @@ -46,6 +56,11 @@ import lombok.Singular; this.rawSet.addAll(rawSet); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSetsBuilder<T> clearRawSet() { + if ((this.rawSet != null)) + this.rawSet.clear(); + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSetsBuilder<T> stringSet(String stringSet) { if ((this.stringSet == null)) this.stringSet = new java.util.ArrayList<String>(); @@ -58,6 +73,11 @@ import lombok.Singular; this.stringSet.addAll(stringSet); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSetsBuilder<T> clearStringSet() { + if ((this.stringSet != null)) + this.stringSet.clear(); + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSets<T> build() { java.util.Set<T> dangerMice; switch (((this.dangerMice == null) ? 0 : this.dangerMice.size())) { diff --git a/test/transform/resource/after-ecj/BuilderWithToBuilder.java b/test/transform/resource/after-ecj/BuilderWithToBuilder.java index 423865ff..0d296cb6 100644 --- a/test/transform/resource/after-ecj/BuilderWithToBuilder.java +++ b/test/transform/resource/after-ecj/BuilderWithToBuilder.java @@ -33,6 +33,11 @@ import lombok.Builder; this.bars.addAll(bars); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithToBuilderBuilder<T> clearBars() { + if ((this.bars != null)) + this.bars.clear(); + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithToBuilder<T> build() { java.util.List<T> bars; switch (((this.bars == null) ? 0 : this.bars.size())) { diff --git a/test/transform/resource/after-ecj/EqualsAndHashcodeOfExclude.java b/test/transform/resource/after-ecj/EqualsAndHashcodeOfExclude.java new file mode 100644 index 00000000..283c5430 --- /dev/null +++ b/test/transform/resource/after-ecj/EqualsAndHashcodeOfExclude.java @@ -0,0 +1,46 @@ +final @lombok.EqualsAndHashCode(of = {"x"}) class EqualsAndHashCodeOf { + int x; + int y; + EqualsAndHashCodeOf() { + super(); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + if ((o == this)) + return true; + if ((! (o instanceof EqualsAndHashCodeOf))) + return false; + final EqualsAndHashCodeOf other = (EqualsAndHashCodeOf) o; + if ((this.x != other.x)) + return false; + return true; + } + public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + final int PRIME = 59; + int result = 1; + result = ((result * PRIME) + this.x); + return result; + } +} +final @lombok.EqualsAndHashCode(exclude = {"y"}) class EqualsAndHashCodeExclude { + int x; + int y; + EqualsAndHashCodeExclude() { + super(); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + if ((o == this)) + return true; + if ((! (o instanceof EqualsAndHashCodeExclude))) + return false; + final EqualsAndHashCodeExclude other = (EqualsAndHashCodeExclude) o; + if ((this.x != other.x)) + return false; + return true; + } + public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + final int PRIME = 59; + int result = 1; + result = ((result * PRIME) + this.x); + return result; + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/FieldDefaultsViaConfig.java b/test/transform/resource/after-ecj/FieldDefaultsViaConfig.java new file mode 100644 index 00000000..689d2601 --- /dev/null +++ b/test/transform/resource/after-ecj/FieldDefaultsViaConfig.java @@ -0,0 +1,15 @@ +class FieldDefaultsViaConfig1 { + private final int x; + private @lombok.experimental.NonFinal int y; + FieldDefaultsViaConfig1(int x) { + super(); + this.x = x; + } +} +@lombok.experimental.FieldDefaults(level = lombok.AccessLevel.PROTECTED) class FieldDefaultsViaConfig2 { + final @lombok.experimental.PackagePrivate int x = 2; + protected final int y = 0; + FieldDefaultsViaConfig2() { + super(); + } +} diff --git a/test/transform/resource/after-ecj/FieldDefaultsViaConfigAndRequiredArgsConstructor.java b/test/transform/resource/after-ecj/FieldDefaultsViaConfigAndRequiredArgsConstructor.java new file mode 100644 index 00000000..6a727f1d --- /dev/null +++ b/test/transform/resource/after-ecj/FieldDefaultsViaConfigAndRequiredArgsConstructor.java @@ -0,0 +1,7 @@ +@lombok.RequiredArgsConstructor class FieldDefaultsViaConfigAndRequiredArgsConstructor { + final int x; + public @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") FieldDefaultsViaConfigAndRequiredArgsConstructor(final int x) { + super(); + this.x = x; + } +} diff --git a/test/transform/resource/after-ecj/NonNullOnParameterOfDefaultMethod.java b/test/transform/resource/after-ecj/NonNullOnParameterOfDefaultMethod.java new file mode 100644 index 00000000..85e99702 --- /dev/null +++ b/test/transform/resource/after-ecj/NonNullOnParameterOfDefaultMethod.java @@ -0,0 +1,10 @@ +interface NonNullOnParameterOfDefaultMethod { + void test(@lombok.NonNull String arg); + default void test2(@lombok.NonNull String arg) { + if ((arg == null)) + { + throw new java.lang.NullPointerException("arg"); + } + System.out.println(arg); + } +} diff --git a/test/transform/resource/before/BuilderInstanceMethod.java b/test/transform/resource/before/BuilderInstanceMethod.java new file mode 100644 index 00000000..666664a2 --- /dev/null +++ b/test/transform/resource/before/BuilderInstanceMethod.java @@ -0,0 +1,8 @@ +import java.util.List; + +class BuilderInstanceMethod<T> { + @lombok.Builder + public String create(int show, final int yes, List<T> also, int $andMe) { + return "" + show + yes + also + $andMe; + } +} diff --git a/test/transform/resource/before/EqualsAndHashCodeOfExclude.java b/test/transform/resource/before/EqualsAndHashCodeOfExclude.java new file mode 100644 index 00000000..0625ba52 --- /dev/null +++ b/test/transform/resource/before/EqualsAndHashCodeOfExclude.java @@ -0,0 +1,11 @@ +@lombok.EqualsAndHashCode(of={"x"}) +final class EqualsAndHashCodeOf { + int x; + int y; +} + +@lombok.EqualsAndHashCode(exclude={"y"}) +final class EqualsAndHashCodeExclude { + int x; + int y; +}
\ No newline at end of file diff --git a/test/transform/resource/before/FieldDefaultsViaConfig.java b/test/transform/resource/before/FieldDefaultsViaConfig.java new file mode 100644 index 00000000..61f6daca --- /dev/null +++ b/test/transform/resource/before/FieldDefaultsViaConfig.java @@ -0,0 +1,16 @@ +//CONF: lombok.fieldDefaults.defaultFinal = true +//CONF: lombok.fieldDefaults.defaultPrivate = true +class FieldDefaultsViaConfig1 { + int x; + @lombok.experimental.NonFinal int y; + + FieldDefaultsViaConfig1(int x) { + this.x = x; + } +} + +@lombok.experimental.FieldDefaults(level = lombok.AccessLevel.PROTECTED) +class FieldDefaultsViaConfig2 { + @lombok.experimental.PackagePrivate int x = 2; + int y = 0; +} diff --git a/test/transform/resource/before/FieldDefaultsViaConfigAndRequiredArgsConstructor.java b/test/transform/resource/before/FieldDefaultsViaConfigAndRequiredArgsConstructor.java new file mode 100644 index 00000000..8c0607d7 --- /dev/null +++ b/test/transform/resource/before/FieldDefaultsViaConfigAndRequiredArgsConstructor.java @@ -0,0 +1,5 @@ +//CONF: lombok.fieldDefaults.defaultFinal = true +@lombok.RequiredArgsConstructor +class FieldDefaultsViaConfigAndRequiredArgsConstructor { + int x; +} diff --git a/test/transform/resource/before/NonNullOnParameterOfDefaultMethod.java b/test/transform/resource/before/NonNullOnParameterOfDefaultMethod.java new file mode 100644 index 00000000..ab343ef0 --- /dev/null +++ b/test/transform/resource/before/NonNullOnParameterOfDefaultMethod.java @@ -0,0 +1,7 @@ +// version 8: +interface NonNullOnParameterOfDefaultMethod { + void test(@lombok.NonNull String arg); + default void test2(@lombok.NonNull String arg) { + System.out.println(arg); + } +} diff --git a/test/transform/resource/before/ValLambda.java b/test/transform/resource/before/ValLambda.java index ed843ed7..51c4fba1 100644 --- a/test/transform/resource/before/ValLambda.java +++ b/test/transform/resource/before/ValLambda.java @@ -14,7 +14,7 @@ class ValLambda { } // public void castLubLambda() { -// Runnable foo = (Runnable)((System.currentTimeMillis() > 0) ? ()-> {} : System.out::println); -// lombok.val foo = (Runnable)((System.currentTimeMillis() > 0) ? ()-> {} : System.out::println); +// Runnable foo = (Runnable) ((System.currentTimeMillis() > 0) ? () -> {} : System.out::println); +// lombok.val foo = (Runnable) ((System.currentTimeMillis() > 0) ? () -> {} : System.out::println); // } } diff --git a/test/transform/resource/messages-delombok/NonNullOnParameterAbstract.java.messages b/test/transform/resource/messages-delombok/NonNullOnParameterAbstract.java.messages deleted file mode 100644 index fd5bffd5..00000000 --- a/test/transform/resource/messages-delombok/NonNullOnParameterAbstract.java.messages +++ /dev/null @@ -1 +0,0 @@ -6 @NonNull is meaningless on a parameter of an abstract method. diff --git a/test/transform/resource/messages-ecj/NonNullOnParameterAbstract.java.messages b/test/transform/resource/messages-ecj/NonNullOnParameterAbstract.java.messages deleted file mode 100644 index 8eb312ef..00000000 --- a/test/transform/resource/messages-ecj/NonNullOnParameterAbstract.java.messages +++ /dev/null @@ -1 +0,0 @@ -6 @NonNull is meaningless on a parameter of an abstract method.
\ No newline at end of file diff --git a/test/transform/resource/messages-idempotent/NonNullOnParameterAbstract.java.messages b/test/transform/resource/messages-idempotent/NonNullOnParameterAbstract.java.messages deleted file mode 100644 index 0d9fcfdc..00000000 --- a/test/transform/resource/messages-idempotent/NonNullOnParameterAbstract.java.messages +++ /dev/null @@ -1 +0,0 @@ -9 @NonNull is meaningless on a parameter of an abstract method.
\ No newline at end of file |