aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource/before
diff options
context:
space:
mode:
authorMichael Ernst <mernst@cs.washington.edu>2021-12-07 11:16:11 -0800
committerMichael Ernst <mernst@cs.washington.edu>2021-12-07 11:16:11 -0800
commit3f5e4a2819d2f03d634a06861ff5487af320b719 (patch)
treeba9ab7ba2f582bb179624e2bb3f717bea5d9a421 /test/transform/resource/before
parent0b4cc60c2367845ebc362e4b254f9e96a66d53c3 (diff)
parentd3b763f9dab4a46e88ff10bc2132fb6f12fda639 (diff)
downloadlombok-3f5e4a2819d2f03d634a06861ff5487af320b719.tar.gz
lombok-3f5e4a2819d2f03d634a06861ff5487af320b719.tar.bz2
lombok-3f5e4a2819d2f03d634a06861ff5487af320b719.zip
Merge ../lombok-branch-master into nullness-annotations
Diffstat (limited to 'test/transform/resource/before')
-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/BuilderNestedInEnum.java12
-rw-r--r--test/transform/resource/before/BuilderWithJavaBeansSpecCapitalization.java7
-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/FieldDefaultsViaConfigOnRecord.java7
-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/GetterWithJavaBeansSpecCapitalization.java5
-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/SetterWithJavaBeansSpecCapitalization.java5
-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.java22
-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/ValInvalidParameter.java32
-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/ValueWithJavaBeansSpecCapitalization.java5
-rw-r--r--test/transform/resource/before/WithByInAnonymousClass.java13
-rw-r--r--test/transform/resource/before/WithInAnonymousClass.java12
-rw-r--r--test/transform/resource/before/WithWithJavaBeansSpecCapitalization.java8
51 files changed, 339 insertions, 6 deletions
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/BuilderNestedInEnum.java b/test/transform/resource/before/BuilderNestedInEnum.java
new file mode 100644
index 00000000..99348002
--- /dev/null
+++ b/test/transform/resource/before/BuilderNestedInEnum.java
@@ -0,0 +1,12 @@
+// issue #3014: Builder check if its on a non-static inner class and errors if it is. But it was erroring here even though it is on a static inner class.
+class BuilderNestedInEnum {
+ public enum TestEnum {
+ FOO, BAR;
+
+ @lombok.Builder
+ @lombok.Value
+ public static class TestBuilder {
+ String field;
+ }
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/before/BuilderWithJavaBeansSpecCapitalization.java b/test/transform/resource/before/BuilderWithJavaBeansSpecCapitalization.java
new file mode 100644
index 00000000..db1fe15f
--- /dev/null
+++ b/test/transform/resource/before/BuilderWithJavaBeansSpecCapitalization.java
@@ -0,0 +1,7 @@
+//CONF: lombok.accessors.capitalization = beanspec
+@lombok.Builder(setterPrefix = "set")
+class BuilderWithJavaBeansSpecCapitalization {
+ @lombok.Singular("z") java.util.List<String> a;
+ @lombok.Singular("yField") java.util.List<String> aField;
+ String bField;
+}
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/FieldDefaultsViaConfigOnRecord.java b/test/transform/resource/before/FieldDefaultsViaConfigOnRecord.java
new file mode 100644
index 00000000..e72179e9
--- /dev/null
+++ b/test/transform/resource/before/FieldDefaultsViaConfigOnRecord.java
@@ -0,0 +1,7 @@
+// version 14:
+//CONF: lombok.fieldDefaults.defaultFinal = true
+//CONF: lombok.fieldDefaults.defaultPrivate = true
+//unchanged
+
+public record FieldDefaultsViaConfigOnRecord(String a, String b) {
+} \ 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/GetterWithJavaBeansSpecCapitalization.java b/test/transform/resource/before/GetterWithJavaBeansSpecCapitalization.java
new file mode 100644
index 00000000..68f41e3d
--- /dev/null
+++ b/test/transform/resource/before/GetterWithJavaBeansSpecCapitalization.java
@@ -0,0 +1,5 @@
+//CONF: lombok.accessors.capitalization = beanspec
+class GetterWithJavaBeansSpecCapitalization {
+ @lombok.Getter int a;
+ @lombok.Getter int aField;
+}
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/SetterWithJavaBeansSpecCapitalization.java b/test/transform/resource/before/SetterWithJavaBeansSpecCapitalization.java
new file mode 100644
index 00000000..b5e34ba7
--- /dev/null
+++ b/test/transform/resource/before/SetterWithJavaBeansSpecCapitalization.java
@@ -0,0 +1,5 @@
+//CONF: lombok.accessors.capitalization = beanspec
+class SetterWithJavaBeansSpecCapitalization {
+ @lombok.Setter int a;
+ @lombok.Setter int aField;
+}
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..b17c997a
--- /dev/null
+++ b/test/transform/resource/before/ValAnonymousSubclassSelfReference.java
@@ -0,0 +1,22 @@
+// version :9
+// 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/ValInvalidParameter.java b/test/transform/resource/before/ValInvalidParameter.java
new file mode 100644
index 00000000..f4961c4e
--- /dev/null
+++ b/test/transform/resource/before/ValInvalidParameter.java
@@ -0,0 +1,32 @@
+//version :9
+import lombok.val;
+
+public class ValInvalidParameter {
+ public void val() {
+ val a = a(new NonExistingClass());
+ val b = a(a(new NonExistingClass()));
+ val c = nonExisitingMethod(b(1));
+ val d = nonExistingObject.nonExistingMethod();
+ val e = b(1).nonExistingMethod();
+ val f = 1 > 2 ? a(new NonExistingClass()) : a(new NonExistingClass());
+ val g = b2(1);
+ val h = b2(a("a"), a(null));
+ val 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/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/ValueWithJavaBeansSpecCapitalization.java b/test/transform/resource/before/ValueWithJavaBeansSpecCapitalization.java
new file mode 100644
index 00000000..7c001f6e
--- /dev/null
+++ b/test/transform/resource/before/ValueWithJavaBeansSpecCapitalization.java
@@ -0,0 +1,5 @@
+//CONF: lombok.accessors.capitalization = beanspec
+@lombok.Value
+class ValueWithJavaBeansSpecCapitalization {
+ final int aField;
+}
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/before/WithWithJavaBeansSpecCapitalization.java b/test/transform/resource/before/WithWithJavaBeansSpecCapitalization.java
new file mode 100644
index 00000000..ef4a78ad
--- /dev/null
+++ b/test/transform/resource/before/WithWithJavaBeansSpecCapitalization.java
@@ -0,0 +1,8 @@
+//CONF: lombok.accessors.capitalization = beanspec
+@lombok.With
+class WithWithJavaBeansSpecCapitalization {
+ int aField;
+
+ WithWithJavaBeansSpecCapitalization(int aField) {
+ }
+}