mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
SSR: fix lambda matching problem
This commit is contained in:
+1
-1
@@ -392,7 +392,7 @@ public class JavaMatchingVisitor extends JavaElementVisitor {
|
||||
result = myMatchingVisitor.matchSons(parameterList1, expression2.getParameterList());
|
||||
}
|
||||
final PsiElement body1 = getElementToMatch(expression.getBody());
|
||||
if (body1 != null) {
|
||||
if (body1 != null && result) {
|
||||
result = myMatchingVisitor.matchSequentially(body1, getElementToMatch(expression2.getBody()));
|
||||
}
|
||||
myMatchingVisitor.setResult(result);
|
||||
|
||||
+3
@@ -2955,6 +2955,9 @@ public class StructuralSearchTest extends StructuralSearchTestCase {
|
||||
|
||||
String pattern5 = "()->{/*comment*/}";
|
||||
assertEquals("should find lambdas with comment body", 1, findMatchesCount(source, pattern5));
|
||||
|
||||
String pattern6 = "('_Parameter+) -> System.out.println()";
|
||||
assertEquals("should find lambdas with at least one parameter and matching body", 0, findMatchesCount(source, pattern6));
|
||||
}
|
||||
|
||||
public void testFindDefaultMethods() {
|
||||
|
||||
Reference in New Issue
Block a user