mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IG: ignore visibility for covariant equals (IDEA-158274)
This commit is contained in:
+1
-4
@@ -55,9 +55,6 @@ public class CovariantEqualsInspection extends BaseInspection {
|
||||
if (!HardcodedMethodConstants.EQUALS.equals(name)) {
|
||||
return;
|
||||
}
|
||||
if (!method.hasModifierProperty(PsiModifier.PUBLIC)) {
|
||||
return;
|
||||
}
|
||||
final PsiParameterList parameterList = method.getParameterList();
|
||||
if (parameterList.getParametersCount() != 1) {
|
||||
return;
|
||||
@@ -71,7 +68,7 @@ public class CovariantEqualsInspection extends BaseInspection {
|
||||
if (aClass == null) {
|
||||
return;
|
||||
}
|
||||
final PsiMethod[] methods = aClass.getMethods();
|
||||
final PsiMethod[] methods = aClass.findMethodsByName("equals", false);
|
||||
for (PsiMethod method1 : methods) {
|
||||
if (MethodUtils.isEquals(method1)) {
|
||||
return;
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.siyeh.igtest.bugs;
|
||||
|
||||
public class CovariantEqualsInspection
|
||||
{
|
||||
public CovariantEqualsInspection()
|
||||
{
|
||||
}
|
||||
|
||||
public boolean equals(CovariantEqualsInspection foo)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.siyeh.igtest.bugs;
|
||||
|
||||
public class CovariantEqualsInspection2
|
||||
{
|
||||
public CovariantEqualsInspection2()
|
||||
{
|
||||
}
|
||||
|
||||
public boolean equals(CovariantEqualsInspection2 foo)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean equals(Object foo)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+5
@@ -28,4 +28,9 @@ class D implements I {
|
||||
public boolean equals(I i) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
class E {
|
||||
boolean <warning descr="'equals()' should take 'Object' as its argument">equals</warning>(E e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user