fix assertion with code block lambda

This commit is contained in:
Anna Kozlova
2016-02-09 19:35:03 +01:00
parent 1f640238e0
commit b4d2e26d84
3 changed files with 38 additions and 1 deletions

View File

@@ -0,0 +1,16 @@
// "Replace with lambda" "true"
class A {
{
bar(() -> foo());
}
private <T> void bar(ThrowableComputable<T, Exception> throwableComputable) {}
private <K> K foo() throws Exception {
return null;
}
interface ThrowableComputable<T, T1 extends Throwable> {
T compute() throws T1;
}
}

View File

@@ -0,0 +1,21 @@
// "Replace with lambda" "true"
class A {
{
bar(new Throwabl<caret>eComputable<String, Exception>() {
@Override
public String compute() throws Exception {
return foo();
}
});
}
private <T> void bar(ThrowableComputable<T, Exception> throwableComputable) {}
private <K> K foo() throws Exception {
return null;
}
interface ThrowableComputable<T, T1 extends Throwable> {
T compute() throws T1;
}
}