trivial functional: fix dangling return (IDEA-229670)

GitOrigin-RevId: f69be223e2d79dae71ce7fb82aeb0f82eb5e5cb6
This commit is contained in:
Anna.Kozlova
2019-12-30 11:35:31 +00:00
committed by intellij-monorepo-bot
parent dd5ed9a83e
commit 1601753a54
3 changed files with 40 additions and 1 deletions
@@ -0,0 +1,16 @@
// "Replace method call on lambda with lambda body" "true"
import java.util.function.Supplier;
abstract class TrivialUsageInline {
public <T> T evaluateUnderLock(Supplier<T> supplier) {
if (true) {
return supplier.get();
}
else {
return null;
}
}
}
@@ -0,0 +1,18 @@
// "Replace method call on lambda with lambda body" "true"
import java.util.function.Supplier;
abstract class TrivialUsageInline {
public <T> T evaluateUnderLock(Supplier<T> supplier) {
return ((Supplier<T>) () -> {
if (true) {
return supplier.get();
}
else {
return null;
}
}).g<caret>et();
}
}