diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2015-11-22 23:32:15 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2015-11-22 23:32:15 +0100 |
commit | ba2cde332acedebb0905fb8c42bc516b07400917 (patch) | |
tree | 8e53136b1ff2b29970ad8ce6d63d0cf53f873c82 /test | |
parent | e05feead3fdd912fbc9f034f922d4d28df2104e7 (diff) | |
download | lombok-ba2cde332acedebb0905fb8c42bc516b07400917.tar.gz lombok-ba2cde332acedebb0905fb8c42bc516b07400917.tar.bz2 lombok-ba2cde332acedebb0905fb8c42bc516b07400917.zip |
[Fixes #972] 1-arg lambdas with explicit typing on the argument did not pretty print correctly.
Diffstat (limited to 'test')
-rw-r--r-- | test/pretty/resource/after/Lambda.java | 13 | ||||
-rw-r--r-- | test/pretty/resource/before/Lambda.java | 18 |
2 files changed, 29 insertions, 2 deletions
diff --git a/test/pretty/resource/after/Lambda.java b/test/pretty/resource/after/Lambda.java index 54d7caa0..949c4c04 100644 --- a/test/pretty/resource/after/Lambda.java +++ b/test/pretty/resource/after/Lambda.java @@ -4,4 +4,15 @@ public class Lambda { java.util.Comparator<Integer> c2 = (Integer a, Integer b) -> { return a - b; }; -}
\ No newline at end of file + java.util.function.Function<String, String> fnc = (String c) -> c; + void testLambdaInArgsList(String name, java.util.function.Function<String, String> f) { + } + void testLambdaInArgsList2(java.util.function.Function<String, String> f, String name) { + } + void test() { + testLambdaInArgsList("hello", (String c) -> c); + testLambdaInArgsList("hello", c -> c); + testLambdaInArgsList2((String c) -> c, "hello"); + testLambdaInArgsList2(c -> c, "hello"); + } +} diff --git a/test/pretty/resource/before/Lambda.java b/test/pretty/resource/before/Lambda.java index e7784df5..b9f8c719 100644 --- a/test/pretty/resource/before/Lambda.java +++ b/test/pretty/resource/before/Lambda.java @@ -5,4 +5,20 @@ public class Lambda { java.util.Comparator<Integer> c2 = (Integer a, Integer b) -> { return a - b; }; -}
\ No newline at end of file + java.util.function.Function<String, String> fnc = (String c) -> c; + + void testLambdaInArgsList(String name, java.util.function.Function<String, String> f) { + + } + + void testLambdaInArgsList2(java.util.function.Function<String, String> f, String name) { + + } + + void test() { + testLambdaInArgsList("hello", (String c) -> c); + testLambdaInArgsList("hello", c -> c); + testLambdaInArgsList2((String c) -> c, "hello"); + testLambdaInArgsList2(c -> c, "hello"); + } +} |