aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource/after-delombok
diff options
context:
space:
mode:
Diffstat (limited to 'test/transform/resource/after-delombok')
-rw-r--r--test/transform/resource/after-delombok/BuilderSingularToBuilderWithNull.java4
-rw-r--r--test/transform/resource/after-delombok/BuilderWithToBuilder.java77
-rw-r--r--test/transform/resource/after-delombok/EqualsAndHashCodeExplicitInclude.java22
-rw-r--r--test/transform/resource/after-delombok/NoArgsConstructorForce.java1
-rw-r--r--test/transform/resource/after-delombok/ToStringExplicitInclude.java8
5 files changed, 53 insertions, 59 deletions
diff --git a/test/transform/resource/after-delombok/BuilderSingularToBuilderWithNull.java b/test/transform/resource/after-delombok/BuilderSingularToBuilderWithNull.java
index b0563858..96ffd2dc 100644
--- a/test/transform/resource/after-delombok/BuilderSingularToBuilderWithNull.java
+++ b/test/transform/resource/after-delombok/BuilderSingularToBuilderWithNull.java
@@ -58,6 +58,8 @@ class BuilderSingularToBuilderWithNull {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularToBuilderWithNullBuilder toBuilder() {
- return new BuilderSingularToBuilderWithNullBuilder().elems(this.elems == null ? java.util.Collections.<String>emptyList() : this.elems);
+ final BuilderSingularToBuilderWithNullBuilder builder = new BuilderSingularToBuilderWithNullBuilder();
+ if (this.elems != null) builder.elems(this.elems);
+ return builder;
}
}
diff --git a/test/transform/resource/after-delombok/BuilderWithToBuilder.java b/test/transform/resource/after-delombok/BuilderWithToBuilder.java
index 8615a40b..53256107 100644
--- a/test/transform/resource/after-delombok/BuilderWithToBuilder.java
+++ b/test/transform/resource/after-delombok/BuilderWithToBuilder.java
@@ -86,7 +86,9 @@ class BuilderWithToBuilder<T> {
}
@java.lang.SuppressWarnings("all")
public BuilderWithToBuilderBuilder<T> toBuilder() {
- return new BuilderWithToBuilderBuilder<T>().one(this.mOne).two(this.mTwo).foo(BuilderWithToBuilder.rrr(this)).bars(this.bars == null ? java.util.Collections.<T>emptyList() : this.bars);
+ final BuilderWithToBuilderBuilder<T> builder = new BuilderWithToBuilderBuilder<T>().one(this.mOne).two(this.mTwo).foo(BuilderWithToBuilder.rrr(this));
+ if (this.bars != null) builder.bars(this.bars);
+ return builder;
}
}
class ConstructorWithToBuilder<T> {
@@ -94,15 +96,17 @@ class ConstructorWithToBuilder<T> {
private String mTwo;
private T foo;
@lombok.Singular
- private List<T> bars;
- public ConstructorWithToBuilder(String mOne, T bar) {
+ private com.google.common.collect.ImmutableList<T> bars;
+ public ConstructorWithToBuilder(String mOne, T baz, com.google.common.collect.ImmutableList<T> bars) {
}
@java.lang.SuppressWarnings("all")
public static class ConstructorWithToBuilderBuilder<T> {
@java.lang.SuppressWarnings("all")
private String mOne;
@java.lang.SuppressWarnings("all")
- private T bar;
+ private T baz;
+ @java.lang.SuppressWarnings("all")
+ private com.google.common.collect.ImmutableList<T> bars;
@java.lang.SuppressWarnings("all")
ConstructorWithToBuilderBuilder() {
}
@@ -112,18 +116,23 @@ class ConstructorWithToBuilder<T> {
return this;
}
@java.lang.SuppressWarnings("all")
- public ConstructorWithToBuilderBuilder<T> bar(final T bar) {
- this.bar = bar;
+ public ConstructorWithToBuilderBuilder<T> baz(final T baz) {
+ this.baz = baz;
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public ConstructorWithToBuilderBuilder<T> bars(final com.google.common.collect.ImmutableList<T> bars) {
+ this.bars = bars;
return this;
}
@java.lang.SuppressWarnings("all")
public ConstructorWithToBuilder<T> build() {
- return new ConstructorWithToBuilder<T>(mOne, bar);
+ return new ConstructorWithToBuilder<T>(mOne, baz, bars);
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
public java.lang.String toString() {
- return "ConstructorWithToBuilder.ConstructorWithToBuilderBuilder(mOne=" + this.mOne + ", bar=" + this.bar + ")";
+ return "ConstructorWithToBuilder.ConstructorWithToBuilderBuilder(mOne=" + this.mOne + ", baz=" + this.baz + ", bars=" + this.bars + ")";
}
}
@java.lang.SuppressWarnings("all")
@@ -132,54 +141,6 @@ class ConstructorWithToBuilder<T> {
}
@java.lang.SuppressWarnings("all")
public ConstructorWithToBuilderBuilder<T> toBuilder() {
- return new ConstructorWithToBuilderBuilder<T>().mOne(this.mOne).bar(this.foo);
+ return new ConstructorWithToBuilderBuilder<T>().mOne(this.mOne).baz(this.foo).bars(this.bars);
}
-}
-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")
- public static class StaticWithToBuilderBuilder<Z> {
- @java.lang.SuppressWarnings("all")
- private String mOne;
- @java.lang.SuppressWarnings("all")
- private Z bar;
- @java.lang.SuppressWarnings("all")
- StaticWithToBuilderBuilder() {
- }
- @java.lang.SuppressWarnings("all")
- public StaticWithToBuilderBuilder<Z> mOne(final String mOne) {
- this.mOne = mOne;
- return this;
- }
- @java.lang.SuppressWarnings("all")
- public StaticWithToBuilderBuilder<Z> bar(final Z bar) {
- this.bar = bar;
- return this;
- }
- @java.lang.SuppressWarnings("all")
- public StaticWithToBuilder<Z, String> build() {
- return StaticWithToBuilder.<Z>test(mOne, bar);
- }
- @java.lang.Override
- @java.lang.SuppressWarnings("all")
- public java.lang.String toString() {
- return "StaticWithToBuilder.StaticWithToBuilderBuilder(mOne=" + this.mOne + ", bar=" + this.bar + ")";
- }
- }
- @java.lang.SuppressWarnings("all")
- public static <Z> StaticWithToBuilderBuilder<Z> builder() {
- return new StaticWithToBuilderBuilder<Z>();
- }
- @java.lang.SuppressWarnings("all")
- public StaticWithToBuilderBuilder<T> toBuilder() {
- return new StaticWithToBuilderBuilder<T>().mOne(this.mOne).bar(this.foo);
- }
-}
+} \ No newline at end of file
diff --git a/test/transform/resource/after-delombok/EqualsAndHashCodeExplicitInclude.java b/test/transform/resource/after-delombok/EqualsAndHashCodeExplicitInclude.java
new file mode 100644
index 00000000..7de3d5fe
--- /dev/null
+++ b/test/transform/resource/after-delombok/EqualsAndHashCodeExplicitInclude.java
@@ -0,0 +1,22 @@
+class EqualsAndHashCodeExplicitInclude {
+ int x;
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public boolean equals(final java.lang.Object o) {
+ if (o == this) return true;
+ if (!(o instanceof EqualsAndHashCodeExplicitInclude)) return false;
+ final EqualsAndHashCodeExplicitInclude other = (EqualsAndHashCodeExplicitInclude) o;
+ if (!other.canEqual((java.lang.Object) this)) return false;
+ return true;
+ }
+ @java.lang.SuppressWarnings("all")
+ protected boolean canEqual(final java.lang.Object other) {
+ return other instanceof EqualsAndHashCodeExplicitInclude;
+ }
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public int hashCode() {
+ int result = 1;
+ return result;
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/after-delombok/NoArgsConstructorForce.java b/test/transform/resource/after-delombok/NoArgsConstructorForce.java
index 3336ca19..d4bfcda2 100644
--- a/test/transform/resource/after-delombok/NoArgsConstructorForce.java
+++ b/test/transform/resource/after-delombok/NoArgsConstructorForce.java
@@ -3,6 +3,7 @@ public class NoArgsConstructorForce {
private final int[] i;
private final Object[] o;
private final java.util.List<?>[] fullQualifiedList;
+ private final String alreadyInitialized = "yes";
@java.lang.SuppressWarnings("all")
public NoArgsConstructorForce() {
diff --git a/test/transform/resource/after-delombok/ToStringExplicitInclude.java b/test/transform/resource/after-delombok/ToStringExplicitInclude.java
new file mode 100644
index 00000000..e6b4c09a
--- /dev/null
+++ b/test/transform/resource/after-delombok/ToStringExplicitInclude.java
@@ -0,0 +1,8 @@
+class ToStringExplicitInclude {
+ int x;
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public java.lang.String toString() {
+ return "ToStringExplicitInclude()";
+ }
+} \ No newline at end of file