Merge remote-tracking branch 'origin/master'

This commit is contained in:
Roman Shevchenko
2015-10-01 16:15:09 +02:00
2 changed files with 2 additions and 2 deletions

View File

@@ -327,7 +327,7 @@ public class AnonymousCanBeLambdaInspection extends BaseJavaBatchLocalInspection
public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
final PsiElement element = descriptor.getPsiElement();
if (element != null) {
replacePsiElementWithLambda(element, false, true);
replacePsiElementWithLambda(element, false, false);
}
}

View File

@@ -56,7 +56,7 @@ public class GuavaFunctionAndPredicateConverter {
if (expression instanceof PsiNewExpression) {
final PsiAnonymousClass anonymousClass = ((PsiNewExpression)expression).getAnonymousClass();
if (anonymousClass != null && AnonymousCanBeLambdaInspection.canBeConvertedToLambda(anonymousClass, true)) {
final PsiExpression lambdaExpression = AnonymousCanBeLambdaInspection.replacePsiElementWithLambda(expression, true, true);
final PsiExpression lambdaExpression = AnonymousCanBeLambdaInspection.replacePsiElementWithLambda(expression, true, false);
LOG.assertTrue(lambdaExpression != null);
return lambdaExpression.getText();
}