aboutsummaryrefslogtreecommitdiff
path: root/test/transform
diff options
context:
space:
mode:
Diffstat (limited to 'test/transform')
-rw-r--r--test/transform/resource/after-delombok/ValAnonymousSubclassWithGenerics.java18
-rw-r--r--test/transform/resource/after-ecj/ValAnonymousSubclassWithGenerics.java28
-rw-r--r--test/transform/resource/before/ValAnonymousSubclassWithGenerics.java2
-rw-r--r--test/transform/resource/before/ValWithLocalClasses.java1
-rw-r--r--test/transform/resource/messages-ecj/ValAnonymousSubclassWithGenerics.java.messages1
5 files changed, 49 insertions, 1 deletions
diff --git a/test/transform/resource/after-delombok/ValAnonymousSubclassWithGenerics.java b/test/transform/resource/after-delombok/ValAnonymousSubclassWithGenerics.java
new file mode 100644
index 00000000..25a9e0ce
--- /dev/null
+++ b/test/transform/resource/after-delombok/ValAnonymousSubclassWithGenerics.java
@@ -0,0 +1,18 @@
+import java.util.*;
+public class ValAnonymousSubclassWithGenerics {
+ Object object = new Object(){
+ void foo() {
+ final int j = 1;
+ }
+ };
+ void bar() {
+ final int k = super.hashCode();
+ int x = k;
+ }
+ java.util.List<String> names = new java.util.ArrayList<String>(){
+ public String get(int i) {
+ final java.lang.String result = super.get(i);
+ return result;
+ }
+ };
+}
diff --git a/test/transform/resource/after-ecj/ValAnonymousSubclassWithGenerics.java b/test/transform/resource/after-ecj/ValAnonymousSubclassWithGenerics.java
new file mode 100644
index 00000000..989555fc
--- /dev/null
+++ b/test/transform/resource/after-ecj/ValAnonymousSubclassWithGenerics.java
@@ -0,0 +1,28 @@
+import java.util.*;
+import lombok.val;
+public class ValAnonymousSubclassWithGenerics {
+ Object object = new Object() {
+ x() {
+ super();
+ }
+ void foo() {
+ final @val int j = 1;
+ }
+ };
+ java.util.List<String> names = new java.util.ArrayList<String>() {
+ x() {
+ super();
+ }
+ public String get(int i) {
+ final @val java.lang.String result = super.get(i);
+ return result;
+ }
+ };
+ public ValAnonymousSubclassWithGenerics() {
+ super();
+ }
+ void bar() {
+ final @val int k = super.hashCode();
+ int x = k;
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/before/ValAnonymousSubclassWithGenerics.java b/test/transform/resource/before/ValAnonymousSubclassWithGenerics.java
index 49fc86e0..c0f8157a 100644
--- a/test/transform/resource/before/ValAnonymousSubclassWithGenerics.java
+++ b/test/transform/resource/before/ValAnonymousSubclassWithGenerics.java
@@ -1,4 +1,4 @@
-// ignore
+// 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/ValWithLocalClasses.java b/test/transform/resource/before/ValWithLocalClasses.java
index 8c6be4f9..572a1e7d 100644
--- a/test/transform/resource/before/ValWithLocalClasses.java
+++ b/test/transform/resource/before/ValWithLocalClasses.java
@@ -1,3 +1,4 @@
+//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 {
{
lombok.val f2 = new ValWithLocalClasses2() {};
diff --git a/test/transform/resource/messages-ecj/ValAnonymousSubclassWithGenerics.java.messages b/test/transform/resource/messages-ecj/ValAnonymousSubclassWithGenerics.java.messages
new file mode 100644
index 00000000..37f87639
--- /dev/null
+++ b/test/transform/resource/messages-ecj/ValAnonymousSubclassWithGenerics.java.messages
@@ -0,0 +1 @@
+17 The serializable class does not declare a static final serialVersionUID field of type long \ No newline at end of file