mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-06 05:10:22 +07:00
inline into method reference: keep with multiple return statements
This commit is contained in:
@@ -311,7 +311,7 @@ public class InlineUtil {
|
||||
|
||||
public static TailCallType getTailCallType(@NotNull final PsiReference psiReference) {
|
||||
PsiElement element = psiReference.getElement();
|
||||
if (element instanceof PsiMethodReferenceExpression) return TailCallType.None;
|
||||
if (element instanceof PsiMethodReferenceExpression) return TailCallType.Return;
|
||||
PsiExpression methodCall = PsiTreeUtil.getParentOfType(element, PsiMethodCallExpression.class);
|
||||
if (methodCall == null) return TailCallType.None;
|
||||
PsiElement callParent = methodCall.getParent();
|
||||
|
||||
@@ -6,6 +6,7 @@ class Test {
|
||||
}
|
||||
|
||||
private String get() {
|
||||
if (true) return null;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,14 @@ import java.util.function.Supplier;
|
||||
|
||||
class Test {
|
||||
{
|
||||
Supplier<String> sup = () -> null;
|
||||
Supplier<String> sup = () -> {
|
||||
if (true) return null;
|
||||
return null;
|
||||
};
|
||||
}
|
||||
|
||||
private String get() {
|
||||
if (true) return null;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user