diff options
Diffstat (limited to 'test/transform/resource/after-delombok')
38 files changed, 533 insertions, 126 deletions
diff --git a/test/transform/resource/after-delombok/Accessors.java b/test/transform/resource/after-delombok/Accessors.java index 3346bacb..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; @@ -100,7 +100,7 @@ class AccessorsPrefix3 { final int PRIME = 59; int result = 1; final java.lang.Object $fName = this.getName(); - result = result * PRIME + ($fName == null ? 0 : $fName.hashCode()); + result = result * PRIME + ($fName == null ? 43 : $fName.hashCode()); return result; } } diff --git a/test/transform/resource/after-delombok/BuilderSingularNoAutosingularize.java b/test/transform/resource/after-delombok/BuilderSingularNoAuto.java index 8a1d4ef2..0be33a84 100644 --- a/test/transform/resource/after-delombok/BuilderSingularNoAutosingularize.java +++ b/test/transform/resource/after-delombok/BuilderSingularNoAuto.java @@ -1,18 +1,18 @@ import java.util.List; -class BuilderSingularNoAutosingularize { +class BuilderSingularNoAuto { private List<String> things; private List<String> widgets; private List<String> items; @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") - BuilderSingularNoAutosingularize(final List<String> things, final List<String> widgets, final List<String> items) { + BuilderSingularNoAuto(final List<String> things, final List<String> widgets, final List<String> items) { this.things = things; this.widgets = widgets; this.items = items; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") - public static class BuilderSingularNoAutosingularizeBuilder { + public static class BuilderSingularNoAutoBuilder { @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") private java.util.ArrayList<String> things; @@ -24,53 +24,53 @@ class BuilderSingularNoAutosingularize { private java.util.ArrayList<String> items; @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") - BuilderSingularNoAutosingularizeBuilder() { + BuilderSingularNoAutoBuilder() { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") - public BuilderSingularNoAutosingularizeBuilder things(final String things) { + public BuilderSingularNoAutoBuilder things(final String things) { if (this.things == null) this.things = new java.util.ArrayList<String>(); this.things.add(things); return this; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") - public BuilderSingularNoAutosingularizeBuilder things(final java.util.Collection<? extends String> things) { + public BuilderSingularNoAutoBuilder things(final java.util.Collection<? extends String> things) { if (this.things == null) this.things = new java.util.ArrayList<String>(); this.things.addAll(things); return this; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") - public BuilderSingularNoAutosingularizeBuilder widget(final String widget) { + public BuilderSingularNoAutoBuilder widget(final String widget) { if (this.widgets == null) this.widgets = new java.util.ArrayList<String>(); this.widgets.add(widget); return this; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") - public BuilderSingularNoAutosingularizeBuilder widgets(final java.util.Collection<? extends String> widgets) { + public BuilderSingularNoAutoBuilder widgets(final java.util.Collection<? extends String> widgets) { if (this.widgets == null) this.widgets = new java.util.ArrayList<String>(); this.widgets.addAll(widgets); return this; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") - public BuilderSingularNoAutosingularizeBuilder items(final String items) { + public BuilderSingularNoAutoBuilder items(final String items) { if (this.items == null) this.items = new java.util.ArrayList<String>(); this.items.add(items); return this; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") - public BuilderSingularNoAutosingularizeBuilder items(final java.util.Collection<? extends String> items) { + public BuilderSingularNoAutoBuilder items(final java.util.Collection<? extends String> items) { if (this.items == null) this.items = new java.util.ArrayList<String>(); this.items.addAll(items); return this; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") - public BuilderSingularNoAutosingularize build() { + public BuilderSingularNoAuto build() { java.util.List<String> things; switch (this.things == null ? 0 : this.things.size()) { case 0: @@ -104,18 +104,18 @@ class BuilderSingularNoAutosingularize { default: items = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.items)); } - return new BuilderSingularNoAutosingularize(things, widgets, items); + return new BuilderSingularNoAuto(things, widgets, items); } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public java.lang.String toString() { - return "BuilderSingularNoAutosingularize.BuilderSingularNoAutosingularizeBuilder(things=" + this.things + ", widgets=" + this.widgets + ", items=" + this.items + ")"; + return "BuilderSingularNoAuto.BuilderSingularNoAutoBuilder(things=" + this.things + ", widgets=" + this.widgets + ", items=" + this.items + ")"; } } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") - public static BuilderSingularNoAutosingularizeBuilder builder() { - return new BuilderSingularNoAutosingularizeBuilder(); + public static BuilderSingularNoAutoBuilder builder() { + return new BuilderSingularNoAutoBuilder(); } }
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/BuilderWithToBuilder.java b/test/transform/resource/after-delombok/BuilderWithToBuilder.java new file mode 100644 index 00000000..eb61a6db --- /dev/null +++ b/test/transform/resource/after-delombok/BuilderWithToBuilder.java @@ -0,0 +1,216 @@ +import java.util.List; +class BuilderWithToBuilder<T> { + private String mOne; + private String mTwo; + private T foo; + private List<T> bars; + public static <K> K rrr(BuilderWithToBuilder<K> x) { + return x.foo; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + BuilderWithToBuilder(final String one, final String two, final T foo, final List<T> bars) { + this.mOne = one; + this.mTwo = two; + this.foo = foo; + this.bars = bars; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public static class BuilderWithToBuilderBuilder<T> { + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + private String one; + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + private String two; + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + private T foo; + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + private java.util.ArrayList<T> bars; + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + BuilderWithToBuilderBuilder() { + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public BuilderWithToBuilderBuilder<T> one(final String one) { + this.one = one; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public BuilderWithToBuilderBuilder<T> two(final String two) { + this.two = two; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public BuilderWithToBuilderBuilder<T> foo(final T foo) { + this.foo = foo; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public BuilderWithToBuilderBuilder<T> bar(final T bar) { + if (this.bars == null) this.bars = new java.util.ArrayList<T>(); + this.bars.add(bar); + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public BuilderWithToBuilderBuilder<T> bars(final java.util.Collection<? extends T> bars) { + if (this.bars == null) this.bars = new java.util.ArrayList<T>(); + this.bars.addAll(bars); + 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()) { + case 0: + bars = java.util.Collections.emptyList(); + break; + case 1: + bars = java.util.Collections.singletonList(this.bars.get(0)); + break; + default: + bars = java.util.Collections.unmodifiableList(new java.util.ArrayList<T>(this.bars)); + } + return new BuilderWithToBuilder<T>(one, two, foo, bars); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public java.lang.String toString() { + return "BuilderWithToBuilder.BuilderWithToBuilderBuilder(one=" + this.one + ", two=" + this.two + ", foo=" + this.foo + ", bars=" + this.bars + ")"; + } + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public static <T> BuilderWithToBuilderBuilder<T> builder() { + return new BuilderWithToBuilderBuilder<T>(); + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public BuilderWithToBuilderBuilder<T> toBuilder() { + return new BuilderWithToBuilderBuilder<T>().one(this.mOne).two(this.mTwo).foo(BuilderWithToBuilder.rrr(this)).bars(this.bars); + } +} +class ConstructorWithToBuilder<T> { + private String mOne; + private String mTwo; + private T foo; + @lombok.Singular + private List<T> bars; + public ConstructorWithToBuilder(String mOne, T bar) { + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public static class ConstructorWithToBuilderBuilder<T> { + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + private String mOne; + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + private T bar; + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + ConstructorWithToBuilderBuilder() { + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public ConstructorWithToBuilderBuilder<T> mOne(final String mOne) { + this.mOne = mOne; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public ConstructorWithToBuilderBuilder<T> bar(final T bar) { + this.bar = bar; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public ConstructorWithToBuilder<T> build() { + return new ConstructorWithToBuilder<T>(mOne, bar); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public java.lang.String toString() { + return "ConstructorWithToBuilder.ConstructorWithToBuilderBuilder(mOne=" + this.mOne + ", bar=" + this.bar + ")"; + } + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public static <T> ConstructorWithToBuilderBuilder<T> builder() { + return new ConstructorWithToBuilderBuilder<T>(); + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public ConstructorWithToBuilderBuilder<T> toBuilder() { + return new ConstructorWithToBuilderBuilder<T>().mOne(this.mOne).bar(this.foo); + } +} +class StaticWithToBuilder<T, K> { + private String mOne; + private String mTwo; + private T foo; + private K bar; + @lombok.Singular + private List<T> bars; + public static <Z> StaticWithToBuilder<Z, String> test(String mOne, Z bar) { + return new StaticWithToBuilder<Z, String>(); + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public static class StaticWithToBuilderBuilder<Z> { + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + private String mOne; + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + private Z bar; + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + StaticWithToBuilderBuilder() { + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public StaticWithToBuilderBuilder<Z> mOne(final String mOne) { + this.mOne = mOne; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public StaticWithToBuilderBuilder<Z> bar(final Z bar) { + this.bar = bar; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public StaticWithToBuilder build() { + return StaticWithToBuilder.<Z>test(mOne, bar); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public java.lang.String toString() { + return "StaticWithToBuilder.StaticWithToBuilderBuilder(mOne=" + this.mOne + ", bar=" + this.bar + ")"; + } + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public static <Z> StaticWithToBuilderBuilder<Z> builder() { + return new StaticWithToBuilderBuilder<Z>(); + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public StaticWithToBuilderBuilder<T> toBuilder() { + return new StaticWithToBuilderBuilder<T>().mOne(this.mOne).bar(this.foo); + } +} 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/Constructors.java b/test/transform/resource/after-delombok/Constructors.java index 466ae9ee..c138a00c 100644 --- a/test/transform/resource/after-delombok/Constructors.java +++ b/test/transform/resource/after-delombok/Constructors.java @@ -98,3 +98,22 @@ class AllArgsConstructorPackageAccess { this.x = x; } } +class NoArgsConstructor2 { + final int x; + final double y; + final char c; + final boolean b; + final float f; + final String s; + byte z; + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public NoArgsConstructor2() { + this.x = 0; + this.y = 0.0; + this.c = '\000'; + this.b = false; + this.f = 0.0F; + this.s = null; + } +} 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 57f04bf3..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(); @@ -50,7 +50,7 @@ class DataOnLocalClass1 { int result = 1; result = result * PRIME + this.getX(); final java.lang.Object $name = this.getName(); - result = result * PRIME + ($name == null ? 0 : $name.hashCode()); + result = result * PRIME + ($name == null ? 43 : $name.hashCode()); return result; } @java.lang.Override @@ -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; @@ -116,7 +116,7 @@ class DataOnLocalClass2 { final int PRIME = 59; int result = 1; final java.lang.Object $name = this.getName(); - result = result * PRIME + ($name == null ? 0 : $name.hashCode()); + result = result * PRIME + ($name == null ? 43 : $name.hashCode()); return result; } @java.lang.Override @@ -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 4ddb9414..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(); @@ -49,7 +49,7 @@ class Data1 { int result = 1; result = result * PRIME + this.getX(); final java.lang.Object $name = this.getName(); - result = result * PRIME + ($name == null ? 0 : $name.hashCode()); + result = result * PRIME + ($name == null ? 43 : $name.hashCode()); return result; } @java.lang.Override @@ -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(); @@ -110,7 +110,7 @@ class Data2 { int result = 1; result = result * PRIME + this.getX(); final java.lang.Object $name = this.getName(); - result = result * PRIME + ($name == null ? 0 : $name.hashCode()); + result = result * PRIME + ($name == null ? 43 : $name.hashCode()); return result; } @java.lang.Override @@ -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(); @@ -165,7 +165,7 @@ final class Data3 { int result = 1; result = result * PRIME + this.getX(); final java.lang.Object $name = this.getName(); - result = result * PRIME + ($name == null ? 0 : $name.hashCode()); + result = result * PRIME + ($name == null ? 43 : $name.hashCode()); return result; } @java.lang.Override @@ -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 232f783b..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(); @@ -47,7 +47,7 @@ class DataWithGetter { result = result * PRIME + this.getX(); result = result * PRIME + this.getY(); final java.lang.Object $z = this.getZ(); - result = result * PRIME + ($z == null ? 0 : $z.hashCode()); + result = result * PRIME + ($z == null ? 43 : $z.hashCode()); return result; } @java.lang.Override diff --git a/test/transform/resource/after-delombok/DataWithGetterNone.java b/test/transform/resource/after-delombok/DataWithGetterNone.java index 9e1fb60a..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; @@ -47,7 +47,7 @@ class DataWithGetterNone { result = result * PRIME + this.x; result = result * PRIME + this.y; final java.lang.Object $z = this.z; - result = result * PRIME + ($z == null ? 0 : $z.hashCode()); + result = result * PRIME + ($z == null ? 43 : $z.hashCode()); return result; } @java.lang.Override 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 a15b71b0..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; @@ -38,9 +38,9 @@ class EqualsAndHashCode { result = result * PRIME + java.util.Arrays.hashCode(this.y); result = result * PRIME + java.util.Arrays.deepHashCode(this.z); final java.lang.Object $a = this.a; - result = result * PRIME + ($a == null ? 0 : $a.hashCode()); + result = result * PRIME + ($a == null ? 43 : $a.hashCode()); final java.lang.Object $b = this.b; - result = result * PRIME + ($b == null ? 0 : $b.hashCode()); + result = result * PRIME + ($b == null ? 43 : $b.hashCode()); return result; } } @@ -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 733959b0..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; @@ -41,9 +41,9 @@ class EqualsAndHashCodeWithOnParam { result = result * PRIME + java.util.Arrays.hashCode(this.y); result = result * PRIME + java.util.Arrays.deepHashCode(this.z); final java.lang.Object $a = this.a; - result = result * PRIME + ($a == null ? 0 : $a.hashCode()); + result = result * PRIME + ($a == null ? 43 : $a.hashCode()); final java.lang.Object $b = this.b; - result = result * PRIME + ($b == null ? 0 : $b.hashCode()); + result = result * PRIME + ($b == null ? 43 : $b.hashCode()); return result; } }
\ No newline at end of file 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 c89b2980..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; @@ -34,9 +34,9 @@ class GetterLazyEahcToString { final int PRIME = 59; int result = 1; final java.lang.Object $value = this.getValue(); - result = result * PRIME + ($value == null ? 0 : $value.hashCode()); + result = result * PRIME + ($value == null ? 43 : $value.hashCode()); final java.lang.Object $value2 = this.value2; - result = result * PRIME + ($value2 == null ? 0 : $value2.hashCode()); + result = result * PRIME + ($value2 == null ? 43 : $value2.hashCode()); return result; } @@ -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 f4f04fa1..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; } @@ -108,4 +108,58 @@ class GetterSetterJavadoc3 { public void setFieldName(final int fieldName) { this.fieldName = fieldName; } -}
\ No newline at end of file +} +class GetterSetterJavadoc4 { + /** + * Some text + */ + private int fieldName; + /** + * Some text + * + * @return Sky is blue4 + */ + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public int fieldName() { + return this.fieldName; + } + /** + * Some text + * + * @param fieldName Hello, World5 + * @return this + */ + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public GetterSetterJavadoc4 fieldName(final int fieldName) { + this.fieldName = fieldName; + return this; + } +} +class GetterSetterJavadoc5 { + /** + * Some text + */ + private int fieldName; + /** + * Getter section + * @return Sky is blue5 + */ + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public int fieldName() { + return this.fieldName; + } + /** + * Setter section + * @param fieldName Hello, World5 + * @return Sky is blue5 + */ + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public GetterSetterJavadoc5 fieldName(final int fieldName) { + this.fieldName = fieldName; + return this; + } +} diff --git a/test/transform/resource/after-delombok/Helper.java b/test/transform/resource/after-delombok/Helper.java new file mode 100644 index 00000000..52f50dd2 --- /dev/null +++ b/test/transform/resource/after-delombok/Helper.java @@ -0,0 +1,16 @@ +class HelperTest { + void test() { + class H1 { + void foo() { + System.out.println("Hello"); + } + } + final H1 $H1 = new H1(); + $H1.foo(); + class H2 { + void bar() { + $H1.foo(); + } + } + } +} 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 eb7eef09..6b3c1761 100644 --- a/test/transform/resource/after-delombok/UtilityClass.java +++ b/test/transform/resource/after-delombok/UtilityClass.java @@ -1,5 +1,5 @@ final class UtilityClass { - private static String someField; + private static long someField = System.currentTimeMillis(); static void someMethod() { System.out.println(); } @@ -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 09c301d2..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(); @@ -39,7 +39,7 @@ final class Value1 { int result = 1; result = result * PRIME + this.getX(); final java.lang.Object $name = this.getName(); - result = result * PRIME + ($name == null ? 0 : $name.hashCode()); + result = result * PRIME + ($name == null ? 43 : $name.hashCode()); return result; } @java.lang.Override @@ -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(); @@ -96,7 +96,7 @@ class Value2 { int result = 1; result = result * PRIME + this.getX(); final java.lang.Object $name = this.getName(); - result = result * PRIME + ($name == null ? 0 : $name.hashCode()); + result = result * PRIME + ($name == null ? 43 : $name.hashCode()); return result; } @java.lang.Override @@ -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-delombok/ValueStaticField.java b/test/transform/resource/after-delombok/ValueStaticField.java new file mode 100644 index 00000000..cec136f4 --- /dev/null +++ b/test/transform/resource/after-delombok/ValueStaticField.java @@ -0,0 +1,29 @@ +final class ValueStaticField { + private static int x; + private static final String PASSWORD = "Ken sent me"; + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public ValueStaticField() { + } + @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 ValueStaticField)) return false; + return true; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public int hashCode() { + int result = 1; + return result; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public java.lang.String toString() { + return "ValueStaticField()"; + } +}
\ No newline at end of file |