mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
StreamRefactoringUtil#isRefactoringCandidate disable if method reference is not resolved
This commit is contained in:
@@ -33,7 +33,8 @@ public class StreamRefactoringUtil {
|
||||
return lambdaExpression.getParameterList().getParametersCount() == 1 &&
|
||||
(!requireExpressionLambda || LambdaUtil.extractSingleExpressionFromBody(lambdaExpression.getBody()) != null);
|
||||
} else if(expression instanceof PsiMethodReferenceExpression) {
|
||||
return LambdaRefactoringUtil.canConvertToLambdaWithoutSideEffects((PsiMethodReferenceExpression)expression);
|
||||
PsiMethodReferenceExpression methodRef = (PsiMethodReferenceExpression)expression;
|
||||
return methodRef.resolve() != null && LambdaRefactoringUtil.canConvertToLambdaWithoutSideEffects(methodRef);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Inline 'map' body into the next 'map' call" "false"
|
||||
import java.util.List;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
public class Main {
|
||||
public static void test(List<Foo> list) {
|
||||
list.stream().<caret>map(Foo::getBar).map(bar -> bar.getID());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user