mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
SSR: fix CCE on inverted java comment variable
This commit is contained in:
+1
-5
@@ -119,7 +119,7 @@ public class JavaCompilingVisitor extends JavaRecursiveElementWalkingVisitor {
|
||||
for (PsiClass aClass : classes) {
|
||||
if (includeSelf) {
|
||||
final String name = aClass.getName();
|
||||
if (name != null) result.add(name);;
|
||||
if (name != null) result.add(name);
|
||||
}
|
||||
ClassInheritorsSearch.search(aClass, projectAndLibraries, true).forEach(c -> {
|
||||
final String name = c.getName();
|
||||
@@ -177,10 +177,6 @@ public class JavaCompilingVisitor extends JavaRecursiveElementWalkingVisitor {
|
||||
throw new MalformedPatternException();
|
||||
}
|
||||
|
||||
if (handler.getPredicate() != null) {
|
||||
((RegExpPredicate)handler.getPredicate()).setMultiline(true);
|
||||
}
|
||||
|
||||
RegExpPredicate predicate = handler.findRegExpPredicate();
|
||||
if (GlobalCompilingVisitor.isSuitablePredicate(predicate, handler)) {
|
||||
myCompilingVisitor.processTokenizedName(predicate.getRegExp(), true, GlobalCompilingVisitor.OccurenceKind.COMMENT);
|
||||
|
||||
+3
@@ -1385,6 +1385,9 @@ public class StructuralSearchTest extends StructuralSearchTestCase {
|
||||
assertEquals("Comment matching", 3, findMatchesCount(s1, "// 'Comment:[regex( .*(?:comment).* )]"));
|
||||
assertEquals("Comment matching, 2", 3, findMatchesCount(s1, "/* 'Comment:[regex( .*(?:comment).* )] */"));
|
||||
assertEquals("Java doc matching", 1, findMatchesCount(s1, "/** 'Comment:[regex( .*(?:comment).* )] */"));
|
||||
assertEquals("Comment matching with negate", 2, findMatchesCount(s1, "// 'not_comment:[!regex( .*(?:comment).* )]"));
|
||||
assertEquals("Multi line", 1, findMatchesCount(s1, "//'_comment:[regex( .*another.* )]"));
|
||||
assertEquals("Multi line negated", 4, findMatchesCount(s1, "//'_comment:[!regex( .*another.* )]"));
|
||||
|
||||
String s4 = "class X {{ java.util.Arrays.asList(\"'test\", \"another test\", \"garbage\"); }}";
|
||||
assertEquals("Literal content", 2, findMatchesCount(s4, "\"'test:[regex( .*test.* )]\""));
|
||||
|
||||
Reference in New Issue
Block a user