aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2012-04-02 20:47:33 +0200
committerRoel Spilker <r.spilker@gmail.com>2012-04-02 20:47:33 +0200
commitb041b355d64cf0c3ec17f360a1cee27a8fe0ea3f (patch)
tree8ff2d09567bb116fd1ea358cecc6753ae26d711e
parent1954c022a401cebdbb090d0b80c4f01d7bc76ec3 (diff)
downloadlombok-b041b355d64cf0c3ec17f360a1cee27a8fe0ea3f.tar.gz
lombok-b041b355d64cf0c3ec17f360a1cee27a8fe0ea3f.tar.bz2
lombok-b041b355d64cf0c3ec17f360a1cee27a8fe0ea3f.zip
Added tests for issue 358
-rw-r--r--test/transform/resource/after-delombok/ValOutersWithGenerics.java11
-rw-r--r--test/transform/resource/after-ecj/ValOutersWithGenerics.java15
-rw-r--r--test/transform/resource/before/ValOutersWithGenerics.java15
3 files changed, 41 insertions, 0 deletions
diff --git a/test/transform/resource/after-delombok/ValOutersWithGenerics.java b/test/transform/resource/after-delombok/ValOutersWithGenerics.java
index 150e3a2a..901ad2f7 100644
--- a/test/transform/resource/after-delombok/ValOutersWithGenerics.java
+++ b/test/transform/resource/after-delombok/ValOutersWithGenerics.java
@@ -2,6 +2,8 @@ import java.util.*;
public class ValOutersWithGenerics<Z> {
class Inner {
}
+ class InnerWithGenerics<H> {
+ }
public void testOutersWithGenerics() {
final java.lang.String foo = "";
List<Inner> list = new ArrayList<Inner>();
@@ -12,10 +14,19 @@ public class ValOutersWithGenerics<Z> {
}
final Local<java.lang.String> q = new Local<String>();
}
+ public static void test() {
+ final ValOutersWithGenerics<java.lang.String> outer = new ValOutersWithGenerics<String>();
+ final ValOutersWithGenerics<java.lang.String>.Inner inner1 = outer.new Inner();
+ final ValOutersWithGenerics<java.lang.String>.InnerWithGenerics<java.lang.Integer> inner2 = outer.new InnerWithGenerics<Integer>();
+ }
static class SubClass extends ValOutersWithGenerics<String> {
public void testSubClassOfOutersWithGenerics() {
List<Inner> list = new ArrayList<Inner>();
final ValOutersWithGenerics<java.lang.String>.Inner elem = list.get(0);
}
}
+ public static void loop(Map<String, String> map) {
+ for (final java.util.Map.Entry<java.lang.String, java.lang.String> e : map.entrySet()) {
+ }
+ }
}
diff --git a/test/transform/resource/after-ecj/ValOutersWithGenerics.java b/test/transform/resource/after-ecj/ValOutersWithGenerics.java
index b4225ede..da16e7f8 100644
--- a/test/transform/resource/after-ecj/ValOutersWithGenerics.java
+++ b/test/transform/resource/after-ecj/ValOutersWithGenerics.java
@@ -6,6 +6,11 @@ public class ValOutersWithGenerics<Z> {
super();
}
}
+ class InnerWithGenerics<H> {
+ InnerWithGenerics() {
+ super();
+ }
+ }
static class SubClass extends ValOutersWithGenerics<String> {
SubClass() {
super();
@@ -31,4 +36,14 @@ public class ValOutersWithGenerics<Z> {
}
final @val Local<java.lang.String> q = new Local<String>();
}
+ public static void test() {
+ final @val ValOutersWithGenerics<java.lang.String> outer = new ValOutersWithGenerics<String>();
+ final @val ValOutersWithGenerics<java.lang.String>.Inner inner1 = outer.new Inner();
+ final @val ValOutersWithGenerics<java.lang.String>.InnerWithGenerics<java.lang.Integer> inner2 = outer.new InnerWithGenerics<Integer>();
+ }
+ public static void loop(Map<String, String> map) {
+ for (final @val java.util.Map.Entry<java.lang.String, java.lang.String> e : map.entrySet())
+ {
+ }
+ }
}
diff --git a/test/transform/resource/before/ValOutersWithGenerics.java b/test/transform/resource/before/ValOutersWithGenerics.java
index 145f812c..1b29d37c 100644
--- a/test/transform/resource/before/ValOutersWithGenerics.java
+++ b/test/transform/resource/before/ValOutersWithGenerics.java
@@ -2,9 +2,13 @@ import java.util.*;
import lombok.val;
public class ValOutersWithGenerics<Z> {
+
class Inner {
}
+ class InnerWithGenerics<H> {
+ }
+
public void testOutersWithGenerics() {
val foo = "";
List<Inner> list = new ArrayList<Inner>();
@@ -17,10 +21,21 @@ public class ValOutersWithGenerics<Z> {
val q = new Local<String>();
}
+ public static void test() {
+ val outer = new ValOutersWithGenerics<String>();
+ val inner1 = outer.new Inner();
+ val inner2 = outer.new InnerWithGenerics<Integer>();
+ }
+
static class SubClass extends ValOutersWithGenerics<String> {
public void testSubClassOfOutersWithGenerics() {
List<Inner> list = new ArrayList<Inner>();
val elem = list.get(0);
}
}
+
+ public static void loop(Map<String, String> map) {
+ for (val e : map.entrySet()) {
+ }
+ }
}