mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-83207 False "Duplicate switch case" warning in Groovy
This commit is contained in:
+3
-28
@@ -703,9 +703,9 @@ public class EquivalenceChecker {
|
||||
|
||||
private static boolean rangeExpressionsAreEquivalent(@NotNull GrRangeExpression rangeExp1,
|
||||
@NotNull GrRangeExpression rangeExp2) {
|
||||
return expressionsAreEquivalent(getLowerBoundForRange(rangeExp1), getLowerBoundForRange(rangeExp1)) &&
|
||||
expressionsAreEquivalent(getUpperBoundForRange(rangeExp1), getUpperBoundForRange(rangeExp1)) &&
|
||||
isInclusive(rangeExp1) == isInclusive(rangeExp2);
|
||||
return expressionsAreEquivalent(rangeExp1.getLeftOperand(), rangeExp2.getLeftOperand()) &&
|
||||
expressionsAreEquivalent(rangeExp1.getRightOperand(), rangeExp2.getRightOperand()) &&
|
||||
isInclusive(rangeExp1) == isInclusive(rangeExp2);
|
||||
}
|
||||
|
||||
private static boolean isInclusive(GrRangeExpression range) {
|
||||
@@ -717,31 +717,6 @@ public class EquivalenceChecker {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static GrExpression getLowerBoundForRange(GrRangeExpression range) {
|
||||
for (PsiElement child : range.getChildren()) {
|
||||
if (child instanceof GrExpression) {
|
||||
return (GrExpression) child;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static GrExpression getUpperBoundForRange(GrRangeExpression range) {
|
||||
boolean firstChildSeen = false;
|
||||
for (PsiElement child : range.getChildren()) {
|
||||
if (child instanceof GrExpression) {
|
||||
if (firstChildSeen) {
|
||||
return (GrExpression) child;
|
||||
} else {
|
||||
firstChildSeen = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static boolean assignmentExpressionsAreEquivalent(@NotNull GrAssignmentExpression assignExp1,
|
||||
@NotNull GrAssignmentExpression assignExp2) {
|
||||
final IElementType sign1 = assignExp1.getOperationToken();
|
||||
|
||||
Reference in New Issue
Block a user