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/AccessorsInAnonymousClass.java22
-rw-r--r--test/transform/resource/after-delombok/BuilderInAnonymousClass.java8
-rw-r--r--test/transform/resource/after-delombok/BuilderNestedInEnum.java70
-rw-r--r--test/transform/resource/after-delombok/BuilderWithJavaBeansSpecCapitalization.java106
-rw-r--r--test/transform/resource/after-delombok/ConstructorsInAnonymousClass.java34
-rw-r--r--test/transform/resource/after-delombok/DataInAnonymousClass.java56
-rw-r--r--test/transform/resource/after-delombok/EqualsAndHashCodeInAnonymousClass.java36
-rw-r--r--test/transform/resource/after-delombok/FieldDefaultsViaConfigOnRecord.java3
-rw-r--r--test/transform/resource/after-delombok/FieldNameConstantsInAnonymousClass.java8
-rw-r--r--test/transform/resource/after-delombok/GetterInAnonymousClass.java13
-rw-r--r--test/transform/resource/after-delombok/GetterLazyInAnonymousClass.java24
-rw-r--r--test/transform/resource/after-delombok/GetterWithJavaBeansSpecCapitalization.java12
-rw-r--r--test/transform/resource/after-delombok/LoggerSlf4jInAnonymousClass.java7
-rw-r--r--test/transform/resource/after-delombok/SetterInAnonymousClass.java13
-rw-r--r--test/transform/resource/after-delombok/SetterWithJavaBeansSpecCapitalization.java12
-rw-r--r--test/transform/resource/after-delombok/SuperBuilderInAnonymousClass.java12
-rw-r--r--test/transform/resource/after-delombok/SynchronizedInAnonymousClass.java15
-rw-r--r--test/transform/resource/after-delombok/ToStringInAnonymousClass.java14
-rw-r--r--test/transform/resource/after-delombok/UtilityClassInAnonymousClass.java8
-rw-r--r--test/transform/resource/after-delombok/ValAnonymousSubclassSelfReference.java17
-rw-r--r--test/transform/resource/after-delombok/ValInvalidParameter.java29
-rw-r--r--test/transform/resource/after-delombok/ValSwitchExpression.java4
-rw-r--r--test/transform/resource/after-delombok/ValToNative.java15
-rw-r--r--test/transform/resource/after-delombok/ValueInAnonymousClass.java46
-rw-r--r--test/transform/resource/after-delombok/ValueWithJavaBeansSpecCapitalization.java33
-rw-r--r--test/transform/resource/after-delombok/WithByInAnonymousClass.java17
-rw-r--r--test/transform/resource/after-delombok/WithInAnonymousClass.java19
-rw-r--r--test/transform/resource/after-delombok/WithWithJavaBeansSpecCapitalization.java12
28 files changed, 663 insertions, 2 deletions
diff --git a/test/transform/resource/after-delombok/AccessorsInAnonymousClass.java b/test/transform/resource/after-delombok/AccessorsInAnonymousClass.java
new file mode 100644
index 00000000..27fab509
--- /dev/null
+++ b/test/transform/resource/after-delombok/AccessorsInAnonymousClass.java
@@ -0,0 +1,22 @@
+public class AccessorsInAnonymousClass {
+ Object annonymous = new Object() {
+
+ class Inner {
+ private String string;
+
+ @java.lang.SuppressWarnings("all")
+ public String string() {
+ return this.string;
+ }
+
+ /**
+ * @return {@code this}.
+ */
+ @java.lang.SuppressWarnings("all")
+ public Inner string(final String string) {
+ this.string = string;
+ return this;
+ }
+ }
+ };
+}
diff --git a/test/transform/resource/after-delombok/BuilderInAnonymousClass.java b/test/transform/resource/after-delombok/BuilderInAnonymousClass.java
new file mode 100644
index 00000000..4810a0a8
--- /dev/null
+++ b/test/transform/resource/after-delombok/BuilderInAnonymousClass.java
@@ -0,0 +1,8 @@
+public class BuilderInAnonymousClass {
+ Object annonymous = new Object() {
+
+ class Inner {
+ private String string;
+ }
+ };
+}
diff --git a/test/transform/resource/after-delombok/BuilderNestedInEnum.java b/test/transform/resource/after-delombok/BuilderNestedInEnum.java
new file mode 100644
index 00000000..26dc2a06
--- /dev/null
+++ b/test/transform/resource/after-delombok/BuilderNestedInEnum.java
@@ -0,0 +1,70 @@
+class BuilderNestedInEnum {
+ public enum TestEnum {
+ FOO, BAR;
+ public static final class TestBuilder {
+ private final String field;
+ @java.lang.SuppressWarnings("all")
+ TestBuilder(final String field) {
+ this.field = field;
+ }
+ @java.lang.SuppressWarnings("all")
+ public static class TestBuilderBuilder {
+ @java.lang.SuppressWarnings("all")
+ private String field;
+ @java.lang.SuppressWarnings("all")
+ TestBuilderBuilder() {
+ }
+ /**
+ * @return {@code this}.
+ */
+ @java.lang.SuppressWarnings("all")
+ public BuilderNestedInEnum.TestEnum.TestBuilder.TestBuilderBuilder field(final String field) {
+ this.field = field;
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderNestedInEnum.TestEnum.TestBuilder build() {
+ return new BuilderNestedInEnum.TestEnum.TestBuilder(this.field);
+ }
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public java.lang.String toString() {
+ return "BuilderNestedInEnum.TestEnum.TestBuilder.TestBuilderBuilder(field=" + this.field + ")";
+ }
+ }
+ @java.lang.SuppressWarnings("all")
+ public static BuilderNestedInEnum.TestEnum.TestBuilder.TestBuilderBuilder builder() {
+ return new BuilderNestedInEnum.TestEnum.TestBuilder.TestBuilderBuilder();
+ }
+ @java.lang.SuppressWarnings("all")
+ public String getField() {
+ return this.field;
+ }
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public boolean equals(final java.lang.Object o) {
+ if (o == this) return true;
+ if (!(o instanceof BuilderNestedInEnum.TestEnum.TestBuilder)) return false;
+ final BuilderNestedInEnum.TestEnum.TestBuilder other = (BuilderNestedInEnum.TestEnum.TestBuilder) o;
+ final java.lang.Object this$field = this.getField();
+ final java.lang.Object other$field = other.getField();
+ if (this$field == null ? other$field != null : !this$field.equals(other$field)) return false;
+ return true;
+ }
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public int hashCode() {
+ final int PRIME = 59;
+ int result = 1;
+ final java.lang.Object $field = this.getField();
+ result = result * PRIME + ($field == null ? 43 : $field.hashCode());
+ return result;
+ }
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public java.lang.String toString() {
+ return "BuilderNestedInEnum.TestEnum.TestBuilder(field=" + this.getField() + ")";
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/after-delombok/BuilderWithJavaBeansSpecCapitalization.java b/test/transform/resource/after-delombok/BuilderWithJavaBeansSpecCapitalization.java
new file mode 100644
index 00000000..4a21f2c3
--- /dev/null
+++ b/test/transform/resource/after-delombok/BuilderWithJavaBeansSpecCapitalization.java
@@ -0,0 +1,106 @@
+class BuilderWithJavaBeansSpecCapitalization {
+ java.util.List<String> a;
+ java.util.List<String> aField;
+ String bField;
+ @java.lang.SuppressWarnings("all")
+ BuilderWithJavaBeansSpecCapitalization(final java.util.List<String> a, final java.util.List<String> aField, final String bField) {
+ this.a = a;
+ this.aField = aField;
+ this.bField = bField;
+ }
+ @java.lang.SuppressWarnings("all")
+ public static class BuilderWithJavaBeansSpecCapitalizationBuilder {
+ @java.lang.SuppressWarnings("all")
+ private java.util.ArrayList<String> a;
+ @java.lang.SuppressWarnings("all")
+ private java.util.ArrayList<String> aField;
+ @java.lang.SuppressWarnings("all")
+ private String bField;
+ @java.lang.SuppressWarnings("all")
+ BuilderWithJavaBeansSpecCapitalizationBuilder() {
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderWithJavaBeansSpecCapitalization.BuilderWithJavaBeansSpecCapitalizationBuilder setZ(final String z) {
+ if (this.a == null) this.a = new java.util.ArrayList<String>();
+ this.a.add(z);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderWithJavaBeansSpecCapitalization.BuilderWithJavaBeansSpecCapitalizationBuilder setA(final java.util.Collection<? extends String> a) {
+ if (a == null) {
+ throw new java.lang.NullPointerException("a cannot be null");
+ }
+ if (this.a == null) this.a = new java.util.ArrayList<String>();
+ this.a.addAll(a);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderWithJavaBeansSpecCapitalization.BuilderWithJavaBeansSpecCapitalizationBuilder clearA() {
+ if (this.a != null) this.a.clear();
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderWithJavaBeansSpecCapitalization.BuilderWithJavaBeansSpecCapitalizationBuilder setyField(final String yField) {
+ if (this.aField == null) this.aField = new java.util.ArrayList<String>();
+ this.aField.add(yField);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderWithJavaBeansSpecCapitalization.BuilderWithJavaBeansSpecCapitalizationBuilder setaField(final java.util.Collection<? extends String> aField) {
+ if (aField == null) {
+ throw new java.lang.NullPointerException("aField cannot be null");
+ }
+ if (this.aField == null) this.aField = new java.util.ArrayList<String>();
+ this.aField.addAll(aField);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderWithJavaBeansSpecCapitalization.BuilderWithJavaBeansSpecCapitalizationBuilder clearaField() {
+ if (this.aField != null) this.aField.clear();
+ return this;
+ }
+ /**
+ * @return {@code this}.
+ */
+ @java.lang.SuppressWarnings("all")
+ public BuilderWithJavaBeansSpecCapitalization.BuilderWithJavaBeansSpecCapitalizationBuilder setbField(final String bField) {
+ this.bField = bField;
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderWithJavaBeansSpecCapitalization build() {
+ java.util.List<String> a;
+ switch (this.a == null ? 0 : this.a.size()) {
+ case 0:
+ a = java.util.Collections.emptyList();
+ break;
+ case 1:
+ a = java.util.Collections.singletonList(this.a.get(0));
+ break;
+ default:
+ a = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.a));
+ }
+ java.util.List<String> aField;
+ switch (this.aField == null ? 0 : this.aField.size()) {
+ case 0:
+ aField = java.util.Collections.emptyList();
+ break;
+ case 1:
+ aField = java.util.Collections.singletonList(this.aField.get(0));
+ break;
+ default:
+ aField = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.aField));
+ }
+ return new BuilderWithJavaBeansSpecCapitalization(a, aField, this.bField);
+ }
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public java.lang.String toString() {
+ return "BuilderWithJavaBeansSpecCapitalization.BuilderWithJavaBeansSpecCapitalizationBuilder(a=" + this.a + ", aField=" + this.aField + ", bField=" + this.bField + ")";
+ }
+ }
+ @java.lang.SuppressWarnings("all")
+ public static BuilderWithJavaBeansSpecCapitalization.BuilderWithJavaBeansSpecCapitalizationBuilder builder() {
+ return new BuilderWithJavaBeansSpecCapitalization.BuilderWithJavaBeansSpecCapitalizationBuilder();
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/after-delombok/ConstructorsInAnonymousClass.java b/test/transform/resource/after-delombok/ConstructorsInAnonymousClass.java
new file mode 100644
index 00000000..7483718f
--- /dev/null
+++ b/test/transform/resource/after-delombok/ConstructorsInAnonymousClass.java
@@ -0,0 +1,34 @@
+//version 8:
+import lombok.NonNull;
+
+public class ConstructorsInAnonymousClass {
+ Object annonymous = new Object() {
+
+ class Inner {
+ private String string;
+ @NonNull
+ private String string2;
+
+ @java.lang.SuppressWarnings("all")
+ public Inner(final String string, @NonNull final String string2) {
+ if (string2 == null) {
+ throw new java.lang.NullPointerException("string2 is marked non-null but is null");
+ }
+ this.string = string;
+ this.string2 = string2;
+ }
+
+ @java.lang.SuppressWarnings("all")
+ public Inner(@NonNull final String string2) {
+ if (string2 == null) {
+ throw new java.lang.NullPointerException("string2 is marked non-null but is null");
+ }
+ this.string2 = string2;
+ }
+
+ @java.lang.SuppressWarnings("all")
+ public Inner() {
+ }
+ }
+ };
+}
diff --git a/test/transform/resource/after-delombok/DataInAnonymousClass.java b/test/transform/resource/after-delombok/DataInAnonymousClass.java
new file mode 100644
index 00000000..788d7be5
--- /dev/null
+++ b/test/transform/resource/after-delombok/DataInAnonymousClass.java
@@ -0,0 +1,56 @@
+public class DataInAnonymousClass {
+ Object annonymous = new Object() {
+
+ class Inner {
+ private String string;
+
+ @java.lang.SuppressWarnings("all")
+ public Inner() {
+ }
+
+ @java.lang.SuppressWarnings("all")
+ public String getString() {
+ return this.string;
+ }
+
+ @java.lang.SuppressWarnings("all")
+ public void setString(final String string) {
+ this.string = string;
+ }
+
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public boolean equals(final java.lang.Object o) {
+ if (o == this) return true;
+ if (!(o instanceof Inner)) return false;
+ final Inner other = (Inner) o;
+ if (!other.canEqual((java.lang.Object) this)) return false;
+ final java.lang.Object this$string = this.getString();
+ final java.lang.Object other$string = other.getString();
+ if (this$string == null ? other$string != null : !this$string.equals(other$string)) return false;
+ return true;
+ }
+
+ @java.lang.SuppressWarnings("all")
+ protected boolean canEqual(final java.lang.Object other) {
+ return other instanceof Inner;
+ }
+
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public int hashCode() {
+ final int PRIME = 59;
+ int result = 1;
+ final java.lang.Object $string = this.getString();
+ result = result * PRIME + ($string == null ? 43 : $string.hashCode());
+ return result;
+ }
+
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public java.lang.String toString() {
+ return "Inner(string=" + this.getString() + ")";
+ }
+ }
+ };
+}
diff --git a/test/transform/resource/after-delombok/EqualsAndHashCodeInAnonymousClass.java b/test/transform/resource/after-delombok/EqualsAndHashCodeInAnonymousClass.java
new file mode 100644
index 00000000..6f0b5738
--- /dev/null
+++ b/test/transform/resource/after-delombok/EqualsAndHashCodeInAnonymousClass.java
@@ -0,0 +1,36 @@
+public class EqualsAndHashCodeInAnonymousClass {
+ Object annonymous = new Object() {
+
+ class Inner {
+ private String string;
+
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public boolean equals(final java.lang.Object o) {
+ if (o == this) return true;
+ if (!(o instanceof Inner)) return false;
+ final Inner other = (Inner) o;
+ if (!other.canEqual((java.lang.Object) this)) return false;
+ final java.lang.Object this$string = this.string;
+ final java.lang.Object other$string = other.string;
+ if (this$string == null ? other$string != null : !this$string.equals(other$string)) return false;
+ return true;
+ }
+
+ @java.lang.SuppressWarnings("all")
+ protected boolean canEqual(final java.lang.Object other) {
+ return other instanceof Inner;
+ }
+
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public int hashCode() {
+ final int PRIME = 59;
+ int result = 1;
+ final java.lang.Object $string = this.string;
+ result = result * PRIME + ($string == null ? 43 : $string.hashCode());
+ return result;
+ }
+ }
+ };
+}
diff --git a/test/transform/resource/after-delombok/FieldDefaultsViaConfigOnRecord.java b/test/transform/resource/after-delombok/FieldDefaultsViaConfigOnRecord.java
new file mode 100644
index 00000000..1a2ce882
--- /dev/null
+++ b/test/transform/resource/after-delombok/FieldDefaultsViaConfigOnRecord.java
@@ -0,0 +1,3 @@
+// version 14:
+public record FieldDefaultsViaConfigOnRecord(String a, String b) {
+}
diff --git a/test/transform/resource/after-delombok/FieldNameConstantsInAnonymousClass.java b/test/transform/resource/after-delombok/FieldNameConstantsInAnonymousClass.java
new file mode 100644
index 00000000..1f7e7d7a
--- /dev/null
+++ b/test/transform/resource/after-delombok/FieldNameConstantsInAnonymousClass.java
@@ -0,0 +1,8 @@
+public class FieldNameConstantsInAnonymousClass {
+ Object annonymous = new Object() {
+
+ class Inner {
+ private String string;
+ }
+ };
+}
diff --git a/test/transform/resource/after-delombok/GetterInAnonymousClass.java b/test/transform/resource/after-delombok/GetterInAnonymousClass.java
new file mode 100644
index 00000000..3c990545
--- /dev/null
+++ b/test/transform/resource/after-delombok/GetterInAnonymousClass.java
@@ -0,0 +1,13 @@
+public class GetterInAnonymousClass {
+ Object annonymous = new Object() {
+
+ class Inner {
+ private String string;
+
+ @java.lang.SuppressWarnings("all")
+ public String getString() {
+ return this.string;
+ }
+ }
+ };
+}
diff --git a/test/transform/resource/after-delombok/GetterLazyInAnonymousClass.java b/test/transform/resource/after-delombok/GetterLazyInAnonymousClass.java
new file mode 100644
index 00000000..4476e463
--- /dev/null
+++ b/test/transform/resource/after-delombok/GetterLazyInAnonymousClass.java
@@ -0,0 +1,24 @@
+public class GetterLazyInAnonymousClass {
+ Object annonymous = new Object() {
+
+ class Inner {
+ private final java.util.concurrent.atomic.AtomicReference<java.lang.Object> string = new java.util.concurrent.atomic.AtomicReference<java.lang.Object>();
+
+ @java.lang.SuppressWarnings({"all", "unchecked"})
+ public String getString() {
+ java.lang.Object value = this.string.get();
+ if (value == null) {
+ synchronized (this.string) {
+ value = this.string.get();
+ if (value == null) {
+ final String actualValue = "test";
+ value = actualValue == null ? this.string : actualValue;
+ this.string.set(value);
+ }
+ }
+ }
+ return (String) (value == this.string ? null : value);
+ }
+ }
+ };
+}
diff --git a/test/transform/resource/after-delombok/GetterWithJavaBeansSpecCapitalization.java b/test/transform/resource/after-delombok/GetterWithJavaBeansSpecCapitalization.java
new file mode 100644
index 00000000..51ccfe63
--- /dev/null
+++ b/test/transform/resource/after-delombok/GetterWithJavaBeansSpecCapitalization.java
@@ -0,0 +1,12 @@
+class GetterWithJavaBeansSpecCapitalization {
+ int a;
+ int aField;
+ @java.lang.SuppressWarnings("all")
+ public int getA() {
+ return this.a;
+ }
+ @java.lang.SuppressWarnings("all")
+ public int getaField() {
+ return this.aField;
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/after-delombok/LoggerSlf4jInAnonymousClass.java b/test/transform/resource/after-delombok/LoggerSlf4jInAnonymousClass.java
new file mode 100644
index 00000000..1ec25d92
--- /dev/null
+++ b/test/transform/resource/after-delombok/LoggerSlf4jInAnonymousClass.java
@@ -0,0 +1,7 @@
+public class LoggerSlf4jInAnonymousClass {
+ Object annonymous = new Object() {
+
+ class Inner {
+ }
+ };
+}
diff --git a/test/transform/resource/after-delombok/SetterInAnonymousClass.java b/test/transform/resource/after-delombok/SetterInAnonymousClass.java
new file mode 100644
index 00000000..ced2be52
--- /dev/null
+++ b/test/transform/resource/after-delombok/SetterInAnonymousClass.java
@@ -0,0 +1,13 @@
+public class SetterInAnonymousClass {
+ Object annonymous = new Object() {
+
+ class Inner {
+ private String string;
+
+ @java.lang.SuppressWarnings("all")
+ public void setString(final String string) {
+ this.string = string;
+ }
+ }
+ };
+}
diff --git a/test/transform/resource/after-delombok/SetterWithJavaBeansSpecCapitalization.java b/test/transform/resource/after-delombok/SetterWithJavaBeansSpecCapitalization.java
new file mode 100644
index 00000000..de68ee60
--- /dev/null
+++ b/test/transform/resource/after-delombok/SetterWithJavaBeansSpecCapitalization.java
@@ -0,0 +1,12 @@
+class SetterWithJavaBeansSpecCapitalization {
+ int a;
+ int aField;
+ @java.lang.SuppressWarnings("all")
+ public void setA(final int a) {
+ this.a = a;
+ }
+ @java.lang.SuppressWarnings("all")
+ public void setaField(final int aField) {
+ this.aField = aField;
+ }
+}
diff --git a/test/transform/resource/after-delombok/SuperBuilderInAnonymousClass.java b/test/transform/resource/after-delombok/SuperBuilderInAnonymousClass.java
new file mode 100644
index 00000000..cc654919
--- /dev/null
+++ b/test/transform/resource/after-delombok/SuperBuilderInAnonymousClass.java
@@ -0,0 +1,12 @@
+public class SuperBuilderInAnonymousClass {
+ Object annonymous = new Object() {
+
+ class InnerParent {
+ private String string;
+ }
+
+ class InnerChild {
+ private String string;
+ }
+ };
+}
diff --git a/test/transform/resource/after-delombok/SynchronizedInAnonymousClass.java b/test/transform/resource/after-delombok/SynchronizedInAnonymousClass.java
new file mode 100644
index 00000000..904487a3
--- /dev/null
+++ b/test/transform/resource/after-delombok/SynchronizedInAnonymousClass.java
@@ -0,0 +1,15 @@
+public class SynchronizedInAnonymousClass {
+ Object annonymous = new Object() {
+
+ class Inner {
+ @java.lang.SuppressWarnings("all")
+ private final java.lang.Object $lock = new java.lang.Object[0];
+
+ public void foo() {
+ synchronized (this.$lock) {
+ String foo = "bar";
+ }
+ }
+ }
+ };
+}
diff --git a/test/transform/resource/after-delombok/ToStringInAnonymousClass.java b/test/transform/resource/after-delombok/ToStringInAnonymousClass.java
new file mode 100644
index 00000000..aa3651bb
--- /dev/null
+++ b/test/transform/resource/after-delombok/ToStringInAnonymousClass.java
@@ -0,0 +1,14 @@
+public class ToStringInAnonymousClass {
+ Object annonymous = new Object() {
+
+ class Inner {
+ private String string;
+
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public java.lang.String toString() {
+ return "Inner(string=" + this.string + ")";
+ }
+ }
+ };
+}
diff --git a/test/transform/resource/after-delombok/UtilityClassInAnonymousClass.java b/test/transform/resource/after-delombok/UtilityClassInAnonymousClass.java
new file mode 100644
index 00000000..3df9b559
--- /dev/null
+++ b/test/transform/resource/after-delombok/UtilityClassInAnonymousClass.java
@@ -0,0 +1,8 @@
+public class UtilityClassInAnonymousClass {
+ Object annonymous = new Object() {
+
+ class Inner {
+ private String string;
+ }
+ };
+}
diff --git a/test/transform/resource/after-delombok/ValAnonymousSubclassSelfReference.java b/test/transform/resource/after-delombok/ValAnonymousSubclassSelfReference.java
new file mode 100644
index 00000000..a1176a3c
--- /dev/null
+++ b/test/transform/resource/after-delombok/ValAnonymousSubclassSelfReference.java
@@ -0,0 +1,17 @@
+import java.util.Map;
+import java.util.HashMap;
+
+public class ValAnonymousSubclassSelfReference {
+ public <T> void test(T arg) {
+ T d = arg;
+ Integer[] e = new Integer[1];
+ int[] f = new int[0];
+ java.util.Map<java.lang.String, Integer> g = new HashMap<String, Integer>();
+ Integer h = 0;
+ int i = 0;
+ final int j = 1;
+ final int k = 2;
+ new ValAnonymousSubclassSelfReference() {
+ };
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/after-delombok/ValInvalidParameter.java b/test/transform/resource/after-delombok/ValInvalidParameter.java
new file mode 100644
index 00000000..f3d4229c
--- /dev/null
+++ b/test/transform/resource/after-delombok/ValInvalidParameter.java
@@ -0,0 +1,29 @@
+public class ValInvalidParameter {
+ public void val() {
+ final java.lang.Object a = a(new NonExistingClass());
+ final java.lang.Object b = a(a(new NonExistingClass()));
+ final java.lang.Object c = nonExisitingMethod(b(1));
+ final java.lang.Object d = nonExistingObject.nonExistingMethod();
+ final java.lang.Object e = b(1).nonExistingMethod();
+ final java.lang.Object f = 1 > 2 ? a(new NonExistingClass()) : a(new NonExistingClass());
+ final java.lang.Object g = b2(1);
+ final java.lang.Integer h = b2(a("a"), a(null));
+ final int i = a(a(null));
+ }
+
+ public int a(String param) {
+ return 0;
+ }
+
+ public int a(Integer param) {
+ return 0;
+ }
+
+ public Integer b(int i) {
+ return i;
+ }
+
+ public Integer b2(int i, int j) {
+ return i;
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/after-delombok/ValSwitchExpression.java b/test/transform/resource/after-delombok/ValSwitchExpression.java
index a8fa9b0f..ba26c137 100644
--- a/test/transform/resource/after-delombok/ValSwitchExpression.java
+++ b/test/transform/resource/after-delombok/ValSwitchExpression.java
@@ -1,9 +1,9 @@
// version 14:
public class ValSwitchExpression {
public void method(int arg) {
- final int x = switch (arg) {
+ final var x = switch (arg) {
default -> {
- final java.lang.String s = "string";
+ final var s = "string";
yield arg;
}
};
diff --git a/test/transform/resource/after-delombok/ValToNative.java b/test/transform/resource/after-delombok/ValToNative.java
new file mode 100644
index 00000000..64aff9e5
--- /dev/null
+++ b/test/transform/resource/after-delombok/ValToNative.java
@@ -0,0 +1,15 @@
+// version 10:
+import java.io.IOException;
+import java.util.Arrays;
+
+public class ValToNative {
+ private void test() throws IOException {
+ final var intField = 1;
+ for (final var s : Arrays.asList("1")) {
+ final var s2 = s;
+ }
+ try (var in = getClass().getResourceAsStream("ValToNative.class")) {
+ final var j = in.read();
+ }
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/after-delombok/ValueInAnonymousClass.java b/test/transform/resource/after-delombok/ValueInAnonymousClass.java
new file mode 100644
index 00000000..5bab4093
--- /dev/null
+++ b/test/transform/resource/after-delombok/ValueInAnonymousClass.java
@@ -0,0 +1,46 @@
+public class ValueInAnonymousClass {
+ Object annonymous = new Object() {
+
+ final class Inner {
+ private final String string;
+
+ @java.lang.SuppressWarnings("all")
+ public Inner(final String string) {
+ this.string = string;
+ }
+
+ @java.lang.SuppressWarnings("all")
+ public String getString() {
+ return this.string;
+ }
+
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public boolean equals(final java.lang.Object o) {
+ if (o == this) return true;
+ if (!(o instanceof Inner)) return false;
+ final Inner other = (Inner) o;
+ final java.lang.Object this$string = this.getString();
+ final java.lang.Object other$string = other.getString();
+ if (this$string == null ? other$string != null : !this$string.equals(other$string)) return false;
+ return true;
+ }
+
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public int hashCode() {
+ final int PRIME = 59;
+ int result = 1;
+ final java.lang.Object $string = this.getString();
+ result = result * PRIME + ($string == null ? 43 : $string.hashCode());
+ return result;
+ }
+
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public java.lang.String toString() {
+ return "Inner(string=" + this.getString() + ")";
+ }
+ }
+ };
+}
diff --git a/test/transform/resource/after-delombok/ValueWithJavaBeansSpecCapitalization.java b/test/transform/resource/after-delombok/ValueWithJavaBeansSpecCapitalization.java
new file mode 100644
index 00000000..543481e8
--- /dev/null
+++ b/test/transform/resource/after-delombok/ValueWithJavaBeansSpecCapitalization.java
@@ -0,0 +1,33 @@
+final class ValueWithJavaBeansSpecCapitalization {
+ private final int aField;
+ @java.lang.SuppressWarnings("all")
+ public ValueWithJavaBeansSpecCapitalization(final int aField) {
+ this.aField = aField;
+ }
+ @java.lang.SuppressWarnings("all")
+ public int getaField() {
+ return this.aField;
+ }
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public boolean equals(final java.lang.Object o) {
+ if (o == this) return true;
+ if (!(o instanceof ValueWithJavaBeansSpecCapitalization)) return false;
+ final ValueWithJavaBeansSpecCapitalization other = (ValueWithJavaBeansSpecCapitalization) o;
+ if (this.getaField() != other.getaField()) return false;
+ return true;
+ }
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public int hashCode() {
+ final int PRIME = 59;
+ int result = 1;
+ result = result * PRIME + this.getaField();
+ return result;
+ }
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public java.lang.String toString() {
+ return "ValueWithJavaBeansSpecCapitalization(aField=" + this.getaField() + ")";
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/after-delombok/WithByInAnonymousClass.java b/test/transform/resource/after-delombok/WithByInAnonymousClass.java
new file mode 100644
index 00000000..d84955b6
--- /dev/null
+++ b/test/transform/resource/after-delombok/WithByInAnonymousClass.java
@@ -0,0 +1,17 @@
+//version 8:
+public class WithByInAnonymousClass {
+ Object annonymous = new Object() {
+
+ class Inner {
+ private Inner(String string) {
+ }
+
+ private String string;
+
+ @java.lang.SuppressWarnings("all")
+ public Inner withStringBy(final java.util.function.Function<? super String, ? extends String> transformer) {
+ return new Inner(transformer.apply(this.string));
+ }
+ }
+ };
+}
diff --git a/test/transform/resource/after-delombok/WithInAnonymousClass.java b/test/transform/resource/after-delombok/WithInAnonymousClass.java
new file mode 100644
index 00000000..02490533
--- /dev/null
+++ b/test/transform/resource/after-delombok/WithInAnonymousClass.java
@@ -0,0 +1,19 @@
+public class WithInAnonymousClass {
+ Object annonymous = new Object() {
+
+ class Inner {
+ private Inner(String string) {
+ }
+
+ private String string;
+
+ /**
+ * @return a clone of this object, except with this updated property (returns {@code this} if an identical value is passed).
+ */
+ @java.lang.SuppressWarnings("all")
+ public Inner withString(final String string) {
+ return this.string == string ? this : new Inner(string);
+ }
+ }
+ };
+}
diff --git a/test/transform/resource/after-delombok/WithWithJavaBeansSpecCapitalization.java b/test/transform/resource/after-delombok/WithWithJavaBeansSpecCapitalization.java
new file mode 100644
index 00000000..e3737848
--- /dev/null
+++ b/test/transform/resource/after-delombok/WithWithJavaBeansSpecCapitalization.java
@@ -0,0 +1,12 @@
+class WithWithJavaBeansSpecCapitalization {
+ int aField;
+ WithWithJavaBeansSpecCapitalization(int aField) {
+ }
+ /**
+ * @return a clone of this object, except with this updated property (returns {@code this} if an identical value is passed).
+ */
+ @java.lang.SuppressWarnings("all")
+ public WithWithJavaBeansSpecCapitalization withaField(final int aField) {
+ return this.aField == aField ? this : new WithWithJavaBeansSpecCapitalization(aField);
+ }
+}