aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-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/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/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/LoggerSlf4jInAnonymousClass.java7
-rw-r--r--test/transform/resource/after-delombok/SetterInAnonymousClass.java13
-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/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/WithByInAnonymousClass.java17
-rw-r--r--test/transform/resource/after-delombok/WithInAnonymousClass.java19
-rw-r--r--test/transform/resource/after-ecj/AccessorsInAnonymousClass.java29
-rw-r--r--test/transform/resource/after-ecj/BuilderInAnonymousClass.java17
-rw-r--r--test/transform/resource/after-ecj/ConstructorsInAnonymousClass.java38
-rw-r--r--test/transform/resource/after-ecj/DataInAnonymousClass.java50
-rw-r--r--test/transform/resource/after-ecj/EqualsAndHashCodeInAnonymousClass.java41
-rw-r--r--test/transform/resource/after-ecj/FieldNameConstantsInAnonymousClass.java17
-rw-r--r--test/transform/resource/after-ecj/GetterInAnonymousClass.java20
-rw-r--r--test/transform/resource/after-ecj/GetterLazyInAnonymousClass.java34
-rw-r--r--test/transform/resource/after-ecj/LoggerSlf4jInAnonymousClass.java16
-rw-r--r--test/transform/resource/after-ecj/SetterInAnonymousClass.java20
-rw-r--r--test/transform/resource/after-ecj/SuperBuilderInAnonymousClass.java23
-rw-r--r--test/transform/resource/after-ecj/SynchronizedInAnonymousClass.java23
-rw-r--r--test/transform/resource/after-ecj/ToStringInAnonymousClass.java20
-rw-r--r--test/transform/resource/after-ecj/UtilityClassInAnonymousClass.java17
-rw-r--r--test/transform/resource/after-ecj/ValAnonymousSubclassSelfReference.java23
-rw-r--r--test/transform/resource/after-ecj/ValSwitchExpression.java4
-rw-r--r--test/transform/resource/after-ecj/ValToNative.java19
-rw-r--r--test/transform/resource/after-ecj/ValueInAnonymousClass.java43
-rw-r--r--test/transform/resource/after-ecj/WithByInAnonymousClass.java20
-rw-r--r--test/transform/resource/after-ecj/WithInAnonymousClass.java23
-rw-r--r--test/transform/resource/before/AccessorsInAnonymousClass.java14
-rw-r--r--test/transform/resource/before/BuilderInAnonymousClass.java10
-rw-r--r--test/transform/resource/before/ConstructorsInAnonymousClass.java18
-rw-r--r--test/transform/resource/before/DataInAnonymousClass.java10
-rw-r--r--test/transform/resource/before/EqualsAndHashCodeInAnonymousClass.java10
-rw-r--r--test/transform/resource/before/FieldNameConstantsInAnonymousClass.java10
-rw-r--r--test/transform/resource/before/GetterInAnonymousClass.java10
-rw-r--r--test/transform/resource/before/GetterLazyInAnonymousClass.java10
-rw-r--r--test/transform/resource/before/LoggerSlf4jInAnonymousClass.java9
-rw-r--r--test/transform/resource/before/MixGetterVal.java1
-rw-r--r--test/transform/resource/before/SetterInAnonymousClass.java10
-rw-r--r--test/transform/resource/before/SuperBuilderInAnonymousClass.java15
-rw-r--r--test/transform/resource/before/SynchronizedInAnonymousClass.java12
-rw-r--r--test/transform/resource/before/ToStringInAnonymousClass.java10
-rw-r--r--test/transform/resource/before/TrickyTypeResolution.java1
-rw-r--r--test/transform/resource/before/UtilityClassInAnonymousClass.java10
-rw-r--r--test/transform/resource/before/ValAnonymousSubclassSelfReference.java21
-rw-r--r--test/transform/resource/before/ValAnonymousSubclassWithGenerics.java1
-rw-r--r--test/transform/resource/before/ValComplex.java1
-rw-r--r--test/transform/resource/before/ValDefault.java2
-rw-r--r--test/transform/resource/before/ValDelegateMethodReference.java2
-rw-r--r--test/transform/resource/before/ValErrors.java1
-rw-r--r--test/transform/resource/before/ValFinal.java1
-rw-r--r--test/transform/resource/before/ValInBasicFor.java1
-rw-r--r--test/transform/resource/before/ValInFor.java1
-rw-r--r--test/transform/resource/before/ValInLambda.java2
-rw-r--r--test/transform/resource/before/ValInMultiDeclaration.java1
-rw-r--r--test/transform/resource/before/ValInTryWithResources.java2
-rw-r--r--test/transform/resource/before/ValLambda.java2
-rw-r--r--test/transform/resource/before/ValLessSimple.java1
-rw-r--r--test/transform/resource/before/ValLub.java1
-rw-r--r--test/transform/resource/before/ValNullInit.java1
-rw-r--r--test/transform/resource/before/ValOutersWithGenerics.java1
-rw-r--r--test/transform/resource/before/ValRawType.java1
-rw-r--r--test/transform/resource/before/ValSimple.java1
-rw-r--r--test/transform/resource/before/ValToNative.java19
-rw-r--r--test/transform/resource/before/ValWeirdTypes.java2
-rw-r--r--test/transform/resource/before/ValWithLabel.java1
-rw-r--r--test/transform/resource/before/ValWithLocalClasses.java1
-rw-r--r--test/transform/resource/before/ValWithSelfRefGenerics.java1
-rw-r--r--test/transform/resource/before/ValueInAnonymousClass.java10
-rw-r--r--test/transform/resource/before/WithByInAnonymousClass.java13
-rw-r--r--test/transform/resource/before/WithInAnonymousClass.java12
-rw-r--r--test/transform/resource/messages-delombok/BuilderInAnonymousClass.java.messages1
-rw-r--r--test/transform/resource/messages-delombok/FieldNameConstantsInAnonymousClass.java.messages1
-rw-r--r--test/transform/resource/messages-delombok/LoggerSlf4jInAnonymousClass.java.messages1
-rw-r--r--test/transform/resource/messages-delombok/SuperBuilderInAnonymousClass.java.messages2
-rw-r--r--test/transform/resource/messages-delombok/UtilityClassInAnonymousClass.java.messages1
-rw-r--r--test/transform/resource/messages-ecj/BuilderInAnonymousClass.java.messages1
-rw-r--r--test/transform/resource/messages-ecj/FieldNameConstantsInAnonymousClass.java.messages1
-rw-r--r--test/transform/resource/messages-ecj/LoggerSlf4jInAnonymousClass.java.messages1
-rw-r--r--test/transform/resource/messages-ecj/SuperBuilderInAnonymousClass.java.messages2
-rw-r--r--test/transform/resource/messages-ecj/UtilityClassInAnonymousClass.java.messages1
93 files changed, 1150 insertions, 10 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/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/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/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/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/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/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-ecj/AccessorsInAnonymousClass.java b/test/transform/resource/after-ecj/AccessorsInAnonymousClass.java
new file mode 100644
index 00000000..34db4f2d
--- /dev/null
+++ b/test/transform/resource/after-ecj/AccessorsInAnonymousClass.java
@@ -0,0 +1,29 @@
+import lombok.Getter;
+import lombok.Setter;
+import lombok.experimental.Accessors;
+public class AccessorsInAnonymousClass {
+ Object annonymous = new Object() {
+ @Getter @Setter @Accessors(fluent = true) class Inner {
+ private String string;
+ Inner() {
+ super();
+ }
+ public @java.lang.SuppressWarnings("all") String string() {
+ return this.string;
+ }
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") Inner string(final String string) {
+ this.string = string;
+ return this;
+ }
+ }
+ x() {
+ super();
+ }
+ };
+ public AccessorsInAnonymousClass() {
+ super();
+ }
+}
diff --git a/test/transform/resource/after-ecj/BuilderInAnonymousClass.java b/test/transform/resource/after-ecj/BuilderInAnonymousClass.java
new file mode 100644
index 00000000..67660822
--- /dev/null
+++ b/test/transform/resource/after-ecj/BuilderInAnonymousClass.java
@@ -0,0 +1,17 @@
+import lombok.Builder;
+public class BuilderInAnonymousClass {
+ Object annonymous = new Object() {
+ @Builder class Inner {
+ private String string;
+ Inner() {
+ super();
+ }
+ }
+ x() {
+ super();
+ }
+ };
+ public BuilderInAnonymousClass() {
+ super();
+ }
+}
diff --git a/test/transform/resource/after-ecj/ConstructorsInAnonymousClass.java b/test/transform/resource/after-ecj/ConstructorsInAnonymousClass.java
new file mode 100644
index 00000000..545ab04d
--- /dev/null
+++ b/test/transform/resource/after-ecj/ConstructorsInAnonymousClass.java
@@ -0,0 +1,38 @@
+import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
+import lombok.NonNull;
+import lombok.RequiredArgsConstructor;
+public class ConstructorsInAnonymousClass {
+ Object annonymous = new Object() {
+ @AllArgsConstructor @RequiredArgsConstructor @NoArgsConstructor class Inner {
+ private String string;
+ private @NonNull String string2;
+ public @java.lang.SuppressWarnings("all") Inner(final String string, final @NonNull String string2) {
+ super();
+ if ((string2 == null))
+ {
+ throw new java.lang.NullPointerException("string2 is marked non-null but is null");
+ }
+ this.string = string;
+ this.string2 = string2;
+ }
+ public @java.lang.SuppressWarnings("all") Inner(final @NonNull String string2) {
+ super();
+ if ((string2 == null))
+ {
+ throw new java.lang.NullPointerException("string2 is marked non-null but is null");
+ }
+ this.string2 = string2;
+ }
+ public @java.lang.SuppressWarnings("all") Inner() {
+ super();
+ }
+ }
+ x() {
+ super();
+ }
+ };
+ public ConstructorsInAnonymousClass() {
+ super();
+ }
+}
diff --git a/test/transform/resource/after-ecj/DataInAnonymousClass.java b/test/transform/resource/after-ecj/DataInAnonymousClass.java
new file mode 100644
index 00000000..c6e22f80
--- /dev/null
+++ b/test/transform/resource/after-ecj/DataInAnonymousClass.java
@@ -0,0 +1,50 @@
+import lombok.Data;
+public class DataInAnonymousClass {
+ Object annonymous = new Object() {
+ @Data class Inner {
+ private String string;
+ public @java.lang.SuppressWarnings("all") String getString() {
+ return this.string;
+ }
+ public @java.lang.SuppressWarnings("all") void setString(final String string) {
+ this.string = string;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") 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;
+ }
+ protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) {
+ return (other instanceof Inner);
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") 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;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (("Inner(string=" + this.getString()) + ")");
+ }
+ public @java.lang.SuppressWarnings("all") Inner() {
+ super();
+ }
+ }
+ x() {
+ super();
+ }
+ };
+ public DataInAnonymousClass() {
+ super();
+ }
+}
diff --git a/test/transform/resource/after-ecj/EqualsAndHashCodeInAnonymousClass.java b/test/transform/resource/after-ecj/EqualsAndHashCodeInAnonymousClass.java
new file mode 100644
index 00000000..e66850bb
--- /dev/null
+++ b/test/transform/resource/after-ecj/EqualsAndHashCodeInAnonymousClass.java
@@ -0,0 +1,41 @@
+import lombok.EqualsAndHashCode;
+public class EqualsAndHashCodeInAnonymousClass {
+ Object annonymous = new Object() {
+ @EqualsAndHashCode class Inner {
+ private String string;
+ Inner() {
+ super();
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") 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;
+ }
+ protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) {
+ return (other instanceof Inner);
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") 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;
+ }
+ }
+ x() {
+ super();
+ }
+ };
+ public EqualsAndHashCodeInAnonymousClass() {
+ super();
+ }
+}
diff --git a/test/transform/resource/after-ecj/FieldNameConstantsInAnonymousClass.java b/test/transform/resource/after-ecj/FieldNameConstantsInAnonymousClass.java
new file mode 100644
index 00000000..b04bef51
--- /dev/null
+++ b/test/transform/resource/after-ecj/FieldNameConstantsInAnonymousClass.java
@@ -0,0 +1,17 @@
+import lombok.experimental.FieldNameConstants;
+public class FieldNameConstantsInAnonymousClass {
+ Object annonymous = new Object() {
+ @FieldNameConstants class Inner {
+ private String string;
+ Inner() {
+ super();
+ }
+ }
+ x() {
+ super();
+ }
+ };
+ public FieldNameConstantsInAnonymousClass() {
+ super();
+ }
+}
diff --git a/test/transform/resource/after-ecj/GetterInAnonymousClass.java b/test/transform/resource/after-ecj/GetterInAnonymousClass.java
new file mode 100644
index 00000000..30e6338d
--- /dev/null
+++ b/test/transform/resource/after-ecj/GetterInAnonymousClass.java
@@ -0,0 +1,20 @@
+import lombok.Getter;
+public class GetterInAnonymousClass {
+ Object annonymous = new Object() {
+ @Getter class Inner {
+ private String string;
+ Inner() {
+ super();
+ }
+ public @java.lang.SuppressWarnings("all") String getString() {
+ return this.string;
+ }
+ }
+ x() {
+ super();
+ }
+ };
+ public GetterInAnonymousClass() {
+ super();
+ }
+}
diff --git a/test/transform/resource/after-ecj/GetterLazyInAnonymousClass.java b/test/transform/resource/after-ecj/GetterLazyInAnonymousClass.java
new file mode 100644
index 00000000..ab8bc599
--- /dev/null
+++ b/test/transform/resource/after-ecj/GetterLazyInAnonymousClass.java
@@ -0,0 +1,34 @@
+import lombok.Getter;
+public class GetterLazyInAnonymousClass {
+ Object annonymous = new Object() {
+ class Inner {
+ private final @Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.lang.Object> string = new java.util.concurrent.atomic.AtomicReference<java.lang.Object>();
+ Inner() {
+ super();
+ }
+ public @java.lang.SuppressWarnings({"all", "unchecked"}) 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);
+ }
+ }
+ x() {
+ super();
+ }
+ };
+ public GetterLazyInAnonymousClass() {
+ super();
+ }
+}
diff --git a/test/transform/resource/after-ecj/LoggerSlf4jInAnonymousClass.java b/test/transform/resource/after-ecj/LoggerSlf4jInAnonymousClass.java
new file mode 100644
index 00000000..0c78a288
--- /dev/null
+++ b/test/transform/resource/after-ecj/LoggerSlf4jInAnonymousClass.java
@@ -0,0 +1,16 @@
+import lombok.extern.slf4j.Slf4j;
+public class LoggerSlf4jInAnonymousClass {
+ Object annonymous = new Object() {
+ @Slf4j class Inner {
+ Inner() {
+ super();
+ }
+ }
+ x() {
+ super();
+ }
+ };
+ public LoggerSlf4jInAnonymousClass() {
+ super();
+ }
+}
diff --git a/test/transform/resource/after-ecj/SetterInAnonymousClass.java b/test/transform/resource/after-ecj/SetterInAnonymousClass.java
new file mode 100644
index 00000000..fc0bf2d8
--- /dev/null
+++ b/test/transform/resource/after-ecj/SetterInAnonymousClass.java
@@ -0,0 +1,20 @@
+import lombok.Setter;
+public class SetterInAnonymousClass {
+ Object annonymous = new Object() {
+ @Setter class Inner {
+ private String string;
+ Inner() {
+ super();
+ }
+ public @java.lang.SuppressWarnings("all") void setString(final String string) {
+ this.string = string;
+ }
+ }
+ x() {
+ super();
+ }
+ };
+ public SetterInAnonymousClass() {
+ super();
+ }
+}
diff --git a/test/transform/resource/after-ecj/SuperBuilderInAnonymousClass.java b/test/transform/resource/after-ecj/SuperBuilderInAnonymousClass.java
new file mode 100644
index 00000000..238f42df
--- /dev/null
+++ b/test/transform/resource/after-ecj/SuperBuilderInAnonymousClass.java
@@ -0,0 +1,23 @@
+import lombok.experimental.SuperBuilder;
+public class SuperBuilderInAnonymousClass {
+ Object annonymous = new Object() {
+ @SuperBuilder class InnerParent {
+ private String string;
+ InnerParent() {
+ super();
+ }
+ }
+ @SuperBuilder class InnerChild {
+ private String string;
+ InnerChild() {
+ super();
+ }
+ }
+ x() {
+ super();
+ }
+ };
+ public SuperBuilderInAnonymousClass() {
+ super();
+ }
+}
diff --git a/test/transform/resource/after-ecj/SynchronizedInAnonymousClass.java b/test/transform/resource/after-ecj/SynchronizedInAnonymousClass.java
new file mode 100644
index 00000000..77013f2f
--- /dev/null
+++ b/test/transform/resource/after-ecj/SynchronizedInAnonymousClass.java
@@ -0,0 +1,23 @@
+import lombok.Synchronized;
+public class SynchronizedInAnonymousClass {
+ Object annonymous = new Object() {
+ class Inner {
+ private final java.lang.Object $lock = new java.lang.Object[0];
+ Inner() {
+ super();
+ }
+ public @Synchronized void foo() {
+ synchronized (this.$lock)
+ {
+ String foo = "bar";
+ }
+ }
+ }
+ x() {
+ super();
+ }
+ };
+ public SynchronizedInAnonymousClass() {
+ super();
+ }
+}
diff --git a/test/transform/resource/after-ecj/ToStringInAnonymousClass.java b/test/transform/resource/after-ecj/ToStringInAnonymousClass.java
new file mode 100644
index 00000000..02ad2a88
--- /dev/null
+++ b/test/transform/resource/after-ecj/ToStringInAnonymousClass.java
@@ -0,0 +1,20 @@
+import lombok.ToString;
+public class ToStringInAnonymousClass {
+ Object annonymous = new Object() {
+ @ToString class Inner {
+ private String string;
+ Inner() {
+ super();
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (("Inner(string=" + this.string) + ")");
+ }
+ }
+ x() {
+ super();
+ }
+ };
+ public ToStringInAnonymousClass() {
+ super();
+ }
+}
diff --git a/test/transform/resource/after-ecj/UtilityClassInAnonymousClass.java b/test/transform/resource/after-ecj/UtilityClassInAnonymousClass.java
new file mode 100644
index 00000000..e836636d
--- /dev/null
+++ b/test/transform/resource/after-ecj/UtilityClassInAnonymousClass.java
@@ -0,0 +1,17 @@
+import lombok.experimental.UtilityClass;
+public class UtilityClassInAnonymousClass {
+ Object annonymous = new Object() {
+ @UtilityClass class Inner {
+ private String string;
+ Inner() {
+ super();
+ }
+ }
+ x() {
+ super();
+ }
+ };
+ public UtilityClassInAnonymousClass() {
+ super();
+ }
+}
diff --git a/test/transform/resource/after-ecj/ValAnonymousSubclassSelfReference.java b/test/transform/resource/after-ecj/ValAnonymousSubclassSelfReference.java
new file mode 100644
index 00000000..12b0f640
--- /dev/null
+++ b/test/transform/resource/after-ecj/ValAnonymousSubclassSelfReference.java
@@ -0,0 +1,23 @@
+import java.util.Map;
+import java.util.HashMap;
+import lombok.val;
+public class ValAnonymousSubclassSelfReference {
+ public ValAnonymousSubclassSelfReference() {
+ super();
+ }
+ 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 @val int j = 1;
+ final @val int k = 2;
+ new ValAnonymousSubclassSelfReference() {
+ x() {
+ super();
+ }
+ };
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/after-ecj/ValSwitchExpression.java b/test/transform/resource/after-ecj/ValSwitchExpression.java
index 59b503cb..4e848572 100644
--- a/test/transform/resource/after-ecj/ValSwitchExpression.java
+++ b/test/transform/resource/after-ecj/ValSwitchExpression.java
@@ -5,10 +5,10 @@ public class ValSwitchExpression {
super();
}
public void method(int arg) {
- final @val int x = switch (arg) {
+ final @val var x = switch (arg) {
default ->
{
- final @val java.lang.String s = "string";
+ final @val var s = "string";
yield arg;
}
};
diff --git a/test/transform/resource/after-ecj/ValToNative.java b/test/transform/resource/after-ecj/ValToNative.java
new file mode 100644
index 00000000..2c8d721c
--- /dev/null
+++ b/test/transform/resource/after-ecj/ValToNative.java
@@ -0,0 +1,19 @@
+import java.io.IOException;
+import java.util.Arrays;
+import lombok.val;
+public class ValToNative {
+ public ValToNative() {
+ super();
+ }
+ private void test() throws IOException {
+ final @val var intField = 1;
+ for (final @val var s : Arrays.asList("1"))
+ {
+ final @val var s2 = s;
+ }
+ try (final @val var in = getClass().getResourceAsStream("ValToNative.class"))
+ {
+ final @val var j = in.read();
+ }
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/after-ecj/ValueInAnonymousClass.java b/test/transform/resource/after-ecj/ValueInAnonymousClass.java
new file mode 100644
index 00000000..49cf8fc2
--- /dev/null
+++ b/test/transform/resource/after-ecj/ValueInAnonymousClass.java
@@ -0,0 +1,43 @@
+import lombok.Value;
+public class ValueInAnonymousClass {
+ Object annonymous = new Object() {
+ final @Value class Inner {
+ private final String string;
+ public @java.lang.SuppressWarnings("all") String getString() {
+ return this.string;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") 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;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") 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;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (("Inner(string=" + this.getString()) + ")");
+ }
+ public @java.lang.SuppressWarnings("all") Inner(final String string) {
+ super();
+ this.string = string;
+ }
+ }
+ x() {
+ super();
+ }
+ };
+ public ValueInAnonymousClass() {
+ super();
+ }
+}
diff --git a/test/transform/resource/after-ecj/WithByInAnonymousClass.java b/test/transform/resource/after-ecj/WithByInAnonymousClass.java
new file mode 100644
index 00000000..1bc3e80c
--- /dev/null
+++ b/test/transform/resource/after-ecj/WithByInAnonymousClass.java
@@ -0,0 +1,20 @@
+import lombok.experimental.WithBy;
+public class WithByInAnonymousClass {
+ Object annonymous = new Object() {
+ @WithBy class Inner {
+ private String string;
+ private Inner(String string) {
+ super();
+ }
+ public @java.lang.SuppressWarnings("all") Inner withStringBy(final java.util.function.Function<? super String, ? extends String> transformer) {
+ return new Inner(transformer.apply(this.string));
+ }
+ }
+ x() {
+ super();
+ }
+ };
+ public WithByInAnonymousClass() {
+ super();
+ }
+}
diff --git a/test/transform/resource/after-ecj/WithInAnonymousClass.java b/test/transform/resource/after-ecj/WithInAnonymousClass.java
new file mode 100644
index 00000000..fef96022
--- /dev/null
+++ b/test/transform/resource/after-ecj/WithInAnonymousClass.java
@@ -0,0 +1,23 @@
+import lombok.With;
+public class WithInAnonymousClass {
+ Object annonymous = new Object() {
+ @With class Inner {
+ private String string;
+ private Inner(String string) {
+ super();
+ }
+ /**
+ * @return a clone of this object, except with this updated property (returns {@code this} if an identical value is passed).
+ */
+ public @java.lang.SuppressWarnings("all") Inner withString(final String string) {
+ return ((this.string == string) ? this : new Inner(string));
+ }
+ }
+ x() {
+ super();
+ }
+ };
+ public WithInAnonymousClass() {
+ super();
+ }
+}
diff --git a/test/transform/resource/before/AccessorsInAnonymousClass.java b/test/transform/resource/before/AccessorsInAnonymousClass.java
new file mode 100644
index 00000000..0bbab1d6
--- /dev/null
+++ b/test/transform/resource/before/AccessorsInAnonymousClass.java
@@ -0,0 +1,14 @@
+import lombok.Getter;
+import lombok.Setter;
+import lombok.experimental.Accessors;
+
+public class AccessorsInAnonymousClass {
+ Object annonymous = new Object() {
+ @Getter
+ @Setter
+ @Accessors(fluent = true)
+ class Inner {
+ private String string;
+ }
+ };
+} \ No newline at end of file
diff --git a/test/transform/resource/before/BuilderInAnonymousClass.java b/test/transform/resource/before/BuilderInAnonymousClass.java
new file mode 100644
index 00000000..8291e678
--- /dev/null
+++ b/test/transform/resource/before/BuilderInAnonymousClass.java
@@ -0,0 +1,10 @@
+import lombok.Builder;
+
+public class BuilderInAnonymousClass {
+ Object annonymous = new Object() {
+ @Builder
+ class Inner {
+ private String string;
+ }
+ };
+} \ No newline at end of file
diff --git a/test/transform/resource/before/ConstructorsInAnonymousClass.java b/test/transform/resource/before/ConstructorsInAnonymousClass.java
new file mode 100644
index 00000000..a74a7f11
--- /dev/null
+++ b/test/transform/resource/before/ConstructorsInAnonymousClass.java
@@ -0,0 +1,18 @@
+//version 8:
+import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
+import lombok.NonNull;
+import lombok.RequiredArgsConstructor;
+
+public class ConstructorsInAnonymousClass {
+ Object annonymous = new Object() {
+ @AllArgsConstructor
+ @RequiredArgsConstructor
+ @NoArgsConstructor
+ class Inner {
+ private String string;
+ @NonNull
+ private String string2;
+ }
+ };
+} \ No newline at end of file
diff --git a/test/transform/resource/before/DataInAnonymousClass.java b/test/transform/resource/before/DataInAnonymousClass.java
new file mode 100644
index 00000000..3de5ac0b
--- /dev/null
+++ b/test/transform/resource/before/DataInAnonymousClass.java
@@ -0,0 +1,10 @@
+import lombok.Data;
+
+public class DataInAnonymousClass {
+ Object annonymous = new Object() {
+ @Data
+ class Inner {
+ private String string;
+ }
+ };
+} \ No newline at end of file
diff --git a/test/transform/resource/before/EqualsAndHashCodeInAnonymousClass.java b/test/transform/resource/before/EqualsAndHashCodeInAnonymousClass.java
new file mode 100644
index 00000000..0f0995b6
--- /dev/null
+++ b/test/transform/resource/before/EqualsAndHashCodeInAnonymousClass.java
@@ -0,0 +1,10 @@
+import lombok.EqualsAndHashCode;
+
+public class EqualsAndHashCodeInAnonymousClass {
+ Object annonymous = new Object() {
+ @EqualsAndHashCode
+ class Inner {
+ private String string;
+ }
+ };
+} \ No newline at end of file
diff --git a/test/transform/resource/before/FieldNameConstantsInAnonymousClass.java b/test/transform/resource/before/FieldNameConstantsInAnonymousClass.java
new file mode 100644
index 00000000..86325ce5
--- /dev/null
+++ b/test/transform/resource/before/FieldNameConstantsInAnonymousClass.java
@@ -0,0 +1,10 @@
+import lombok.experimental.FieldNameConstants;
+
+public class FieldNameConstantsInAnonymousClass {
+ Object annonymous = new Object() {
+ @FieldNameConstants
+ class Inner {
+ private String string;
+ }
+ };
+} \ No newline at end of file
diff --git a/test/transform/resource/before/GetterInAnonymousClass.java b/test/transform/resource/before/GetterInAnonymousClass.java
new file mode 100644
index 00000000..e8195021
--- /dev/null
+++ b/test/transform/resource/before/GetterInAnonymousClass.java
@@ -0,0 +1,10 @@
+import lombok.Getter;
+
+public class GetterInAnonymousClass {
+ Object annonymous = new Object() {
+ @Getter
+ class Inner {
+ private String string;
+ }
+ };
+} \ No newline at end of file
diff --git a/test/transform/resource/before/GetterLazyInAnonymousClass.java b/test/transform/resource/before/GetterLazyInAnonymousClass.java
new file mode 100644
index 00000000..e342e636
--- /dev/null
+++ b/test/transform/resource/before/GetterLazyInAnonymousClass.java
@@ -0,0 +1,10 @@
+import lombok.Getter;
+
+public class GetterLazyInAnonymousClass {
+ Object annonymous = new Object() {
+ class Inner {
+ @Getter(lazy = true)
+ private final String string = "test";
+ }
+ };
+} \ No newline at end of file
diff --git a/test/transform/resource/before/LoggerSlf4jInAnonymousClass.java b/test/transform/resource/before/LoggerSlf4jInAnonymousClass.java
new file mode 100644
index 00000000..4839c7aa
--- /dev/null
+++ b/test/transform/resource/before/LoggerSlf4jInAnonymousClass.java
@@ -0,0 +1,9 @@
+import lombok.extern.slf4j.Slf4j;
+
+public class LoggerSlf4jInAnonymousClass {
+ Object annonymous = new Object() {
+ @Slf4j
+ class Inner {
+ }
+ };
+} \ No newline at end of file
diff --git a/test/transform/resource/before/MixGetterVal.java b/test/transform/resource/before/MixGetterVal.java
index 3f06b1a8..4568902b 100644
--- a/test/transform/resource/before/MixGetterVal.java
+++ b/test/transform/resource/before/MixGetterVal.java
@@ -1,3 +1,4 @@
+// version :9
import lombok.Getter;
import lombok.val;
diff --git a/test/transform/resource/before/SetterInAnonymousClass.java b/test/transform/resource/before/SetterInAnonymousClass.java
new file mode 100644
index 00000000..1b3c817b
--- /dev/null
+++ b/test/transform/resource/before/SetterInAnonymousClass.java
@@ -0,0 +1,10 @@
+import lombok.Setter;
+
+public class SetterInAnonymousClass {
+ Object annonymous = new Object() {
+ @Setter
+ class Inner {
+ private String string;
+ }
+ };
+} \ No newline at end of file
diff --git a/test/transform/resource/before/SuperBuilderInAnonymousClass.java b/test/transform/resource/before/SuperBuilderInAnonymousClass.java
new file mode 100644
index 00000000..bff871aa
--- /dev/null
+++ b/test/transform/resource/before/SuperBuilderInAnonymousClass.java
@@ -0,0 +1,15 @@
+import lombok.experimental.SuperBuilder;
+
+public class SuperBuilderInAnonymousClass {
+ Object annonymous = new Object() {
+ @SuperBuilder
+ class InnerParent {
+ private String string;
+ }
+
+ @SuperBuilder
+ class InnerChild {
+ private String string;
+ }
+ };
+} \ No newline at end of file
diff --git a/test/transform/resource/before/SynchronizedInAnonymousClass.java b/test/transform/resource/before/SynchronizedInAnonymousClass.java
new file mode 100644
index 00000000..11c623ce
--- /dev/null
+++ b/test/transform/resource/before/SynchronizedInAnonymousClass.java
@@ -0,0 +1,12 @@
+import lombok.Synchronized;
+
+public class SynchronizedInAnonymousClass {
+ Object annonymous = new Object() {
+ class Inner {
+ @Synchronized
+ public void foo() {
+ String foo = "bar";
+ }
+ }
+ };
+} \ No newline at end of file
diff --git a/test/transform/resource/before/ToStringInAnonymousClass.java b/test/transform/resource/before/ToStringInAnonymousClass.java
new file mode 100644
index 00000000..87a7a6c1
--- /dev/null
+++ b/test/transform/resource/before/ToStringInAnonymousClass.java
@@ -0,0 +1,10 @@
+import lombok.ToString;
+
+public class ToStringInAnonymousClass {
+ Object annonymous = new Object() {
+ @ToString
+ class Inner {
+ private String string;
+ }
+ };
+} \ No newline at end of file
diff --git a/test/transform/resource/before/TrickyTypeResolution.java b/test/transform/resource/before/TrickyTypeResolution.java
index 94d97fe0..7f3866ee 100644
--- a/test/transform/resource/before/TrickyTypeResolution.java
+++ b/test/transform/resource/before/TrickyTypeResolution.java
@@ -1,3 +1,4 @@
+// version :9
import lombok.*;
class TrickyDoNothing {
@interface Getter {}
diff --git a/test/transform/resource/before/UtilityClassInAnonymousClass.java b/test/transform/resource/before/UtilityClassInAnonymousClass.java
new file mode 100644
index 00000000..41757502
--- /dev/null
+++ b/test/transform/resource/before/UtilityClassInAnonymousClass.java
@@ -0,0 +1,10 @@
+import lombok.experimental.UtilityClass;
+
+public class UtilityClassInAnonymousClass {
+ Object annonymous = new Object() {
+ @UtilityClass
+ class Inner {
+ private String string;
+ }
+ };
+} \ No newline at end of file
diff --git a/test/transform/resource/before/ValAnonymousSubclassSelfReference.java b/test/transform/resource/before/ValAnonymousSubclassSelfReference.java
new file mode 100644
index 00000000..e7c30c84
--- /dev/null
+++ b/test/transform/resource/before/ValAnonymousSubclassSelfReference.java
@@ -0,0 +1,21 @@
+// issue 2420: to trigger the problem 2 var/val, at least one normal variable and a anonymous self reference is required
+import java.util.Map;
+import java.util.HashMap;
+
+import lombok.val;
+
+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;
+
+ val j = 1;
+ val k = 2;
+
+ new ValAnonymousSubclassSelfReference() { };
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/before/ValAnonymousSubclassWithGenerics.java b/test/transform/resource/before/ValAnonymousSubclassWithGenerics.java
index c0f8157a..a434ba9d 100644
--- a/test/transform/resource/before/ValAnonymousSubclassWithGenerics.java
+++ b/test/transform/resource/before/ValAnonymousSubclassWithGenerics.java
@@ -1,3 +1,4 @@
+// version :9
// issue 205: val inside anonymous inner classes is a bit tricky in javac, this test ensures we don't break it.
import java.util.*;
import lombok.val;
diff --git a/test/transform/resource/before/ValComplex.java b/test/transform/resource/before/ValComplex.java
index e20124a2..f1898cfd 100644
--- a/test/transform/resource/before/ValComplex.java
+++ b/test/transform/resource/before/ValComplex.java
@@ -1,3 +1,4 @@
+// version :9
import lombok.val;
public class ValComplex {
diff --git a/test/transform/resource/before/ValDefault.java b/test/transform/resource/before/ValDefault.java
index 75124c3c..ded4b074 100644
--- a/test/transform/resource/before/ValDefault.java
+++ b/test/transform/resource/before/ValDefault.java
@@ -1,4 +1,4 @@
-// version 8:
+// version 8:9
interface ValDefault {
int size();
diff --git a/test/transform/resource/before/ValDelegateMethodReference.java b/test/transform/resource/before/ValDelegateMethodReference.java
index 3d1f082c..8cfc2c33 100644
--- a/test/transform/resource/before/ValDelegateMethodReference.java
+++ b/test/transform/resource/before/ValDelegateMethodReference.java
@@ -1,4 +1,4 @@
-//version 8:
+//version 8:9
//platform !eclipse: Requires a 'full' eclipse with intialized workspace, and we don't (yet) have that set up properly in the test run.
import lombok.Getter;
import lombok.Setter;
diff --git a/test/transform/resource/before/ValErrors.java b/test/transform/resource/before/ValErrors.java
index 87383719..290a1f72 100644
--- a/test/transform/resource/before/ValErrors.java
+++ b/test/transform/resource/before/ValErrors.java
@@ -1,3 +1,4 @@
+// version :9
// unchanged
import lombok.val;
diff --git a/test/transform/resource/before/ValFinal.java b/test/transform/resource/before/ValFinal.java
index 3c5af366..293c9bce 100644
--- a/test/transform/resource/before/ValFinal.java
+++ b/test/transform/resource/before/ValFinal.java
@@ -1,3 +1,4 @@
+// version :9
import lombok.val;
public class ValFinal {
public void test() {
diff --git a/test/transform/resource/before/ValInBasicFor.java b/test/transform/resource/before/ValInBasicFor.java
index a109bcd3..b137f0d7 100644
--- a/test/transform/resource/before/ValInBasicFor.java
+++ b/test/transform/resource/before/ValInBasicFor.java
@@ -1,3 +1,4 @@
+// version :9
// unchanged
import lombok.val;
diff --git a/test/transform/resource/before/ValInFor.java b/test/transform/resource/before/ValInFor.java
index 35332b34..f2c50139 100644
--- a/test/transform/resource/before/ValInFor.java
+++ b/test/transform/resource/before/ValInFor.java
@@ -1,3 +1,4 @@
+// version :9
import lombok.val;
public class ValInFor {
diff --git a/test/transform/resource/before/ValInLambda.java b/test/transform/resource/before/ValInLambda.java
index 6750d045..a13c79d2 100644
--- a/test/transform/resource/before/ValInLambda.java
+++ b/test/transform/resource/before/ValInLambda.java
@@ -1,4 +1,4 @@
-// version 8:
+// version 8:9
import java.util.function.Function;
import java.util.function.Supplier;
diff --git a/test/transform/resource/before/ValInMultiDeclaration.java b/test/transform/resource/before/ValInMultiDeclaration.java
index 1c333ebb..0f4e604b 100644
--- a/test/transform/resource/before/ValInMultiDeclaration.java
+++ b/test/transform/resource/before/ValInMultiDeclaration.java
@@ -1,3 +1,4 @@
+// version :9
import lombok.val;
public class ValInMultiDeclaration {
public void test() {
diff --git a/test/transform/resource/before/ValInTryWithResources.java b/test/transform/resource/before/ValInTryWithResources.java
index a7820062..5c885f79 100644
--- a/test/transform/resource/before/ValInTryWithResources.java
+++ b/test/transform/resource/before/ValInTryWithResources.java
@@ -1,4 +1,4 @@
-//version 7:
+//version 7:9
import lombok.val;
import java.io.IOException;
diff --git a/test/transform/resource/before/ValLambda.java b/test/transform/resource/before/ValLambda.java
index e956bcd3..8f55d222 100644
--- a/test/transform/resource/before/ValLambda.java
+++ b/test/transform/resource/before/ValLambda.java
@@ -1,4 +1,4 @@
-// version 8:
+// version 8:9
import java.io.Serializable;
class ValLambda {
diff --git a/test/transform/resource/before/ValLessSimple.java b/test/transform/resource/before/ValLessSimple.java
index b81cc22c..1ed738cc 100644
--- a/test/transform/resource/before/ValLessSimple.java
+++ b/test/transform/resource/before/ValLessSimple.java
@@ -1,3 +1,4 @@
+// version :9
import lombok.val;
public class ValLessSimple {
diff --git a/test/transform/resource/before/ValLub.java b/test/transform/resource/before/ValLub.java
index 509a4f8b..e3b55950 100644
--- a/test/transform/resource/before/ValLub.java
+++ b/test/transform/resource/before/ValLub.java
@@ -1,3 +1,4 @@
+// version :9
class ValLub {
public void easyLub() {
java.util.Map<String, Number> m = java.util.Collections.emptyMap();
diff --git a/test/transform/resource/before/ValNullInit.java b/test/transform/resource/before/ValNullInit.java
index 649bc0cd..c1610af3 100644
--- a/test/transform/resource/before/ValNullInit.java
+++ b/test/transform/resource/before/ValNullInit.java
@@ -1,3 +1,4 @@
+// version :9
import lombok.val;
class ValNullInit {
diff --git a/test/transform/resource/before/ValOutersWithGenerics.java b/test/transform/resource/before/ValOutersWithGenerics.java
index 1b29d37c..99b71735 100644
--- a/test/transform/resource/before/ValOutersWithGenerics.java
+++ b/test/transform/resource/before/ValOutersWithGenerics.java
@@ -1,3 +1,4 @@
+// version :9
import java.util.*;
import lombok.val;
diff --git a/test/transform/resource/before/ValRawType.java b/test/transform/resource/before/ValRawType.java
index 3ef8527e..fa47c536 100644
--- a/test/transform/resource/before/ValRawType.java
+++ b/test/transform/resource/before/ValRawType.java
@@ -1,3 +1,4 @@
+// version :9
import java.util.List;
import lombok.val;
diff --git a/test/transform/resource/before/ValSimple.java b/test/transform/resource/before/ValSimple.java
index 04763be2..5d1911da 100644
--- a/test/transform/resource/before/ValSimple.java
+++ b/test/transform/resource/before/ValSimple.java
@@ -1,3 +1,4 @@
+// version :9
import lombok.val;
public class ValSimple {
diff --git a/test/transform/resource/before/ValToNative.java b/test/transform/resource/before/ValToNative.java
new file mode 100644
index 00000000..3b4e6fa8
--- /dev/null
+++ b/test/transform/resource/before/ValToNative.java
@@ -0,0 +1,19 @@
+// version 10:
+import java.io.IOException;
+import java.util.Arrays;
+
+import lombok.val;
+
+public class ValToNative {
+ private void test() throws IOException {
+ val intField = 1;
+
+ for (val s : Arrays.asList("1")) {
+ val s2 = s;
+ }
+
+ try (val in = getClass().getResourceAsStream("ValToNative.class")) {
+ val j = in.read();
+ }
+ }
+}
diff --git a/test/transform/resource/before/ValWeirdTypes.java b/test/transform/resource/before/ValWeirdTypes.java
index f62feca6..710e236b 100644
--- a/test/transform/resource/before/ValWeirdTypes.java
+++ b/test/transform/resource/before/ValWeirdTypes.java
@@ -1,4 +1,4 @@
-// version 8: In java6/7, lub types worked differently, so, the `arraysAsList` method has a slightly different inferred type there.
+// version 8:9 In java6/7, lub types worked differently, so, the `arraysAsList` method has a slightly different inferred type there.
import java.math.BigDecimal;
import java.util.*;
import lombok.val;
diff --git a/test/transform/resource/before/ValWithLabel.java b/test/transform/resource/before/ValWithLabel.java
index f7c3402a..9e15f937 100644
--- a/test/transform/resource/before/ValWithLabel.java
+++ b/test/transform/resource/before/ValWithLabel.java
@@ -1,3 +1,4 @@
+// version :9
import lombok.val;
public class ValWithLabel {
diff --git a/test/transform/resource/before/ValWithLocalClasses.java b/test/transform/resource/before/ValWithLocalClasses.java
index 572a1e7d..0d145aa9 100644
--- a/test/transform/resource/before/ValWithLocalClasses.java
+++ b/test/transform/resource/before/ValWithLocalClasses.java
@@ -1,3 +1,4 @@
+// version :9
//issue 694: In javac, resolving the RHS (which is what val does) can cause an entire class to be resolved, breaking all usage of val inside that class. This tests that we handle that better.
class ValWithLocalClasses1 {
{
diff --git a/test/transform/resource/before/ValWithSelfRefGenerics.java b/test/transform/resource/before/ValWithSelfRefGenerics.java
index d0532606..fdb30d32 100644
--- a/test/transform/resource/before/ValWithSelfRefGenerics.java
+++ b/test/transform/resource/before/ValWithSelfRefGenerics.java
@@ -1,3 +1,4 @@
+// version :9
import lombok.val;
public class ValWithSelfRefGenerics {
public void run(Thing<? extends Comparable<?>> thing, Thing<?> thing2, java.util.List<? extends Number> z) {
diff --git a/test/transform/resource/before/ValueInAnonymousClass.java b/test/transform/resource/before/ValueInAnonymousClass.java
new file mode 100644
index 00000000..c0bde2ab
--- /dev/null
+++ b/test/transform/resource/before/ValueInAnonymousClass.java
@@ -0,0 +1,10 @@
+import lombok.Value;
+
+public class ValueInAnonymousClass {
+ Object annonymous = new Object() {
+ @Value
+ class Inner {
+ private String string;
+ }
+ };
+} \ No newline at end of file
diff --git a/test/transform/resource/before/WithByInAnonymousClass.java b/test/transform/resource/before/WithByInAnonymousClass.java
new file mode 100644
index 00000000..afed6adf
--- /dev/null
+++ b/test/transform/resource/before/WithByInAnonymousClass.java
@@ -0,0 +1,13 @@
+//version 8:
+import lombok.experimental.WithBy;
+
+public class WithByInAnonymousClass {
+ Object annonymous = new Object() {
+ @WithBy
+ class Inner {
+ private Inner(String string) { }
+
+ private String string;
+ }
+ };
+} \ No newline at end of file
diff --git a/test/transform/resource/before/WithInAnonymousClass.java b/test/transform/resource/before/WithInAnonymousClass.java
new file mode 100644
index 00000000..daf1bce5
--- /dev/null
+++ b/test/transform/resource/before/WithInAnonymousClass.java
@@ -0,0 +1,12 @@
+import lombok.With;
+
+public class WithInAnonymousClass {
+ Object annonymous = new Object() {
+ @With
+ class Inner {
+ private Inner(String string) { }
+
+ private String string;
+ }
+ };
+} \ No newline at end of file
diff --git a/test/transform/resource/messages-delombok/BuilderInAnonymousClass.java.messages b/test/transform/resource/messages-delombok/BuilderInAnonymousClass.java.messages
new file mode 100644
index 00000000..7607e734
--- /dev/null
+++ b/test/transform/resource/messages-delombok/BuilderInAnonymousClass.java.messages
@@ -0,0 +1 @@
+5 @Builder is not supported on non-static nested classes.
diff --git a/test/transform/resource/messages-delombok/FieldNameConstantsInAnonymousClass.java.messages b/test/transform/resource/messages-delombok/FieldNameConstantsInAnonymousClass.java.messages
new file mode 100644
index 00000000..b9d4887f
--- /dev/null
+++ b/test/transform/resource/messages-delombok/FieldNameConstantsInAnonymousClass.java.messages
@@ -0,0 +1 @@
+5 @FieldNameConstants is not supported on non-static nested classes.
diff --git a/test/transform/resource/messages-delombok/LoggerSlf4jInAnonymousClass.java.messages b/test/transform/resource/messages-delombok/LoggerSlf4jInAnonymousClass.java.messages
new file mode 100644
index 00000000..d4da9f99
--- /dev/null
+++ b/test/transform/resource/messages-delombok/LoggerSlf4jInAnonymousClass.java.messages
@@ -0,0 +1 @@
+5 @Slf4j is not supported on non-static nested classes.
diff --git a/test/transform/resource/messages-delombok/SuperBuilderInAnonymousClass.java.messages b/test/transform/resource/messages-delombok/SuperBuilderInAnonymousClass.java.messages
new file mode 100644
index 00000000..f0cf3243
--- /dev/null
+++ b/test/transform/resource/messages-delombok/SuperBuilderInAnonymousClass.java.messages
@@ -0,0 +1,2 @@
+5 @SuperBuilder is not supported on non-static nested classes.
+10 @SuperBuilder is not supported on non-static nested classes.
diff --git a/test/transform/resource/messages-delombok/UtilityClassInAnonymousClass.java.messages b/test/transform/resource/messages-delombok/UtilityClassInAnonymousClass.java.messages
new file mode 100644
index 00000000..8884e02d
--- /dev/null
+++ b/test/transform/resource/messages-delombok/UtilityClassInAnonymousClass.java.messages
@@ -0,0 +1 @@
+5 @UtilityClass automatically makes the class static, however, this class cannot be made static.
diff --git a/test/transform/resource/messages-ecj/BuilderInAnonymousClass.java.messages b/test/transform/resource/messages-ecj/BuilderInAnonymousClass.java.messages
new file mode 100644
index 00000000..7607e734
--- /dev/null
+++ b/test/transform/resource/messages-ecj/BuilderInAnonymousClass.java.messages
@@ -0,0 +1 @@
+5 @Builder is not supported on non-static nested classes.
diff --git a/test/transform/resource/messages-ecj/FieldNameConstantsInAnonymousClass.java.messages b/test/transform/resource/messages-ecj/FieldNameConstantsInAnonymousClass.java.messages
new file mode 100644
index 00000000..b9d4887f
--- /dev/null
+++ b/test/transform/resource/messages-ecj/FieldNameConstantsInAnonymousClass.java.messages
@@ -0,0 +1 @@
+5 @FieldNameConstants is not supported on non-static nested classes.
diff --git a/test/transform/resource/messages-ecj/LoggerSlf4jInAnonymousClass.java.messages b/test/transform/resource/messages-ecj/LoggerSlf4jInAnonymousClass.java.messages
new file mode 100644
index 00000000..d4da9f99
--- /dev/null
+++ b/test/transform/resource/messages-ecj/LoggerSlf4jInAnonymousClass.java.messages
@@ -0,0 +1 @@
+5 @Slf4j is not supported on non-static nested classes.
diff --git a/test/transform/resource/messages-ecj/SuperBuilderInAnonymousClass.java.messages b/test/transform/resource/messages-ecj/SuperBuilderInAnonymousClass.java.messages
new file mode 100644
index 00000000..f0cf3243
--- /dev/null
+++ b/test/transform/resource/messages-ecj/SuperBuilderInAnonymousClass.java.messages
@@ -0,0 +1,2 @@
+5 @SuperBuilder is not supported on non-static nested classes.
+10 @SuperBuilder is not supported on non-static nested classes.
diff --git a/test/transform/resource/messages-ecj/UtilityClassInAnonymousClass.java.messages b/test/transform/resource/messages-ecj/UtilityClassInAnonymousClass.java.messages
new file mode 100644
index 00000000..8884e02d
--- /dev/null
+++ b/test/transform/resource/messages-ecj/UtilityClassInAnonymousClass.java.messages
@@ -0,0 +1 @@
+5 @UtilityClass automatically makes the class static, however, this class cannot be made static.