mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 06:05:01 +07:00
[java] value breaks: SSR fixes (IDEA-196643)
This commit is contained in:
+1
-1
@@ -861,7 +861,6 @@ public class JavaStructuralSearchProfile extends StructuralSearchProfile {
|
||||
|
||||
private static boolean isApplicableMinCount(@NotNull PsiElement variableNode) {
|
||||
final PsiElement parent = variableNode.getParent();
|
||||
if (parent instanceof PsiBreakStatement) return true;
|
||||
if (parent instanceof PsiContinueStatement) return true;
|
||||
|
||||
final PsiElement grandParent = parent.getParent();
|
||||
@@ -874,6 +873,7 @@ public class JavaStructuralSearchProfile extends StructuralSearchProfile {
|
||||
if (grandParent instanceof PsiReturnStatement) return true;
|
||||
if (grandParent instanceof PsiAssertStatement) return ((PsiAssertStatement)grandParent).getAssertDescription() == parent;
|
||||
if (grandParent instanceof PsiNameValuePair) return ((PsiNameValuePair)grandParent).getValue() == parent;
|
||||
if (grandParent instanceof PsiBreakStatement) return true;
|
||||
}
|
||||
if (grandParent instanceof PsiExpressionList) {
|
||||
PsiElement label = grandParent.getParent();
|
||||
|
||||
+1
-1
@@ -1280,7 +1280,7 @@ public class JavaMatchingVisitor extends JavaElementVisitor {
|
||||
public void visitBreakStatement(final PsiBreakStatement break1) {
|
||||
final PsiBreakStatement break2 = (PsiBreakStatement)myMatchingVisitor.getElement();
|
||||
|
||||
myMatchingVisitor.setResult(myMatchingVisitor.matchOptionally(break1.getLabelIdentifier(), break2.getLabelIdentifier()));
|
||||
myMatchingVisitor.setResult(myMatchingVisitor.matchOptionally(break1.getExpression(), break2.getExpression()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
-3
@@ -1,13 +1,11 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.structuralsearch;
|
||||
|
||||
import com.intellij.idea.Bombed;
|
||||
import com.intellij.openapi.fileTypes.StdFileTypes;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.structuralsearch.plugin.ui.Configuration;
|
||||
import com.intellij.structuralsearch.plugin.ui.SearchConfiguration;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
@@ -18,7 +16,6 @@ import java.util.stream.Stream;
|
||||
* @author Bas Leijdekkers
|
||||
*/
|
||||
public class JavaPredefinedConfigurationsTest extends StructuralSearchTestCase {
|
||||
@Bombed(user = "roman.shevchenko@jetbrains.com", day = 22, month = Calendar.NOVEMBER)
|
||||
public void testAll() {
|
||||
final Configuration[] templates = JavaPredefinedConfigurations.createPredefinedTemplates();
|
||||
final Map<String, Configuration> configurationMap = Stream.of(templates).collect(Collectors.toMap(Configuration::getName, x -> x));
|
||||
|
||||
-3
@@ -1,7 +1,6 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.structuralsearch;
|
||||
|
||||
import com.intellij.idea.Bombed;
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.fileTypes.StdFileTypes;
|
||||
import com.intellij.psi.*;
|
||||
@@ -11,7 +10,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -2989,7 +2987,6 @@ public class StructuralSearchTest extends StructuralSearchTestCase {
|
||||
assertEquals("Find statement label variable", 2, findMatchesCount(s, "'_l : '_s;"));
|
||||
}
|
||||
|
||||
@Bombed(user = "roman.shevchenko@jetbrains.com", day = 22, month = Calendar.NOVEMBER)
|
||||
public void testFindBreakContinue() {
|
||||
final String s = "class X {" +
|
||||
" void m() {" +
|
||||
|
||||
Reference in New Issue
Block a user