IG: consider anonymous classes not matching (IDEA-185470)

This commit is contained in:
Bas Leijdekkers
2018-01-24 20:17:44 +01:00
parent 5e1260f473
commit 110b24921e
2 changed files with 20 additions and 0 deletions
@@ -804,6 +804,10 @@ public class EquivalenceChecker {
final PsiExpression[] args1 = argumentList1 == null ? null : argumentList1.getExpressions();
final PsiExpressionList argumentList2 = newExpression2.getArgumentList();
final PsiExpression[] args2 = argumentList2 == null ? null : argumentList2.getExpressions();
if (newExpression1.getAnonymousClass() != null || newExpression2.getAnonymousClass() != null) {
// simply consider any anonymous classes not matching
return EXACT_MISMATCH;
}
return expressionsAreEquivalent(args1, args2);
}
@@ -198,4 +198,20 @@ class Declaration {
};
}
}
}
//////////////
class DifferentAnonymous {
Object x() {
return new Object() {
int one;
};
}
}
class DifferentAnonymous2 extends DifferentAnonymous {
@Override
Object x() {
return new Object() {};
}
}