forked from projectlombok/lombok
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fixes projectlombok#2648] Remove copy of generic information
- Loading branch information
Showing
4 changed files
with
96 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
test/transform/resource/after-delombok/ExtensionMethodGeneric.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
class ExtensionMethodGeneric { | ||
public void test() { | ||
List<String> stringList = null; | ||
List<Number> numberList = null; | ||
ExtensionMethodGeneric.Extensions.test(stringList, numberList); | ||
ExtensionMethodGeneric.Extensions.test(stringList); | ||
Integer i = ExtensionMethodGeneric.Extensions.test2(stringList); | ||
Map<String, Integer> map = null; | ||
List<String> l = ExtensionMethodGeneric.Extensions.test(map, stringList, numberList); | ||
} | ||
|
||
static class Extensions { | ||
public static <T> List<T> test(List<String> obj, List<T> list) { | ||
return null; | ||
} | ||
public static <K, V> K test(Map<String, Integer> obj, K k, V v) { | ||
return k; | ||
} | ||
public static <T> T test(List<T> list) { | ||
return null; | ||
} | ||
public static <T, U> U test2(List<T> list) { | ||
return null; | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
test/transform/resource/after-ecj/ExtensionMethodGeneric.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import java.util.List; | ||
import java.util.Map; | ||
import lombok.experimental.ExtensionMethod; | ||
@ExtensionMethod(ExtensionMethodGeneric.Extensions.class) class ExtensionMethodGeneric { | ||
static class Extensions { | ||
Extensions() { | ||
super(); | ||
} | ||
public static <T>List<T> test(List<String> obj, List<T> list) { | ||
return null; | ||
} | ||
public static <K, V>K test(Map<String, Integer> obj, K k, V v) { | ||
return k; | ||
} | ||
public static <T>T test(List<T> list) { | ||
return null; | ||
} | ||
public static <T, U>U test2(List<T> list) { | ||
return null; | ||
} | ||
} | ||
ExtensionMethodGeneric() { | ||
super(); | ||
} | ||
public void test() { | ||
List<String> stringList = null; | ||
List<Number> numberList = null; | ||
ExtensionMethodGeneric.Extensions.test(stringList, numberList); | ||
ExtensionMethodGeneric.Extensions.test(stringList); | ||
Integer i = ExtensionMethodGeneric.Extensions.test2(stringList); | ||
Map<String, Integer> map = null; | ||
List<String> l = ExtensionMethodGeneric.Extensions.test(map, stringList, numberList); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
test/transform/resource/before/ExtensionMethodGeneric.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import lombok.experimental.ExtensionMethod; | ||
|
||
@ExtensionMethod(ExtensionMethodGeneric.Extensions.class) | ||
class ExtensionMethodGeneric { | ||
public void test() { | ||
List<String> stringList = null; | ||
List<Number> numberList = null; | ||
stringList.test(numberList); | ||
stringList.test(); | ||
Integer i = stringList.test2(); | ||
|
||
Map<String, Integer> map = null; | ||
List<String> l = map.test(stringList, numberList); | ||
} | ||
|
||
static class Extensions { | ||
public static <T> List<T> test(List<String> obj, List<T> list) { | ||
return null; | ||
} | ||
public static <K,V> K test(Map<String, Integer> obj, K k, V v) { | ||
return k; | ||
} | ||
public static <T> T test(List<T> list) { | ||
return null; | ||
} | ||
public static <T,U> U test2(List<T> list) { | ||
return null; | ||
} | ||
} | ||
} |