testdata to convert anonymous to lambda with overloads

This commit is contained in:
Anna Kozlova
2016-09-07 15:09:31 +03:00
parent 9ad18ec90d
commit cc00f54706
2 changed files with 55 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
// "Replace with lambda" "true"
import java.util.function.Supplier;
class A {
public <T> T runReadAction( final Supplier<T> computation) {
return null;
}
public <T, E extends Throwable> T runReadAction( ThrowableComputable<T, E> computation) throws E {
return null;
}
{
runReadAction((Supplier<String>) () -> "");
}
}
@FunctionalInterface
interface ThrowableComputable<T, E extends Throwable> {
T compute() throws E;
}

View File

@@ -0,0 +1,30 @@
// "Replace with lambda" "true"
import java.util.function.Supplier;
class A {
public <T> T runReadAction( final Supplier<T> computation) {
return null;
}
public <T, E extends Throwable> T runReadAction( ThrowableComputable<T, E> computation) throws E {
return null;
}
{
runReadAction(new Suppl<caret>ier<String>() {
@Override
public String get() {
return "";
}
});
}
}
@FunctionalInterface
interface ThrowableComputable<T, E extends Throwable> {
T compute() throws E;
}