simplify static checks

This commit is contained in:
Anna.Kozlova
2016-10-26 19:13:17 +02:00
parent 6bc30924e6
commit 3897001f18
@@ -122,9 +122,8 @@ public class JUnitUtil {
}
}
if (psiMethod.getParameterList().getParametersCount() > 0) return false;
if (psiMethod.hasModifierProperty(PsiModifier.STATIC) && SUITE_METHOD_NAME.equals(psiMethod.getName())) return false;
if (!psiMethod.getName().startsWith("test")) return false;
if (psiMethod.hasModifierProperty(PsiModifier.STATIC)) return false;
if (!psiMethod.getName().startsWith("test")) return false;
PsiClass testCaseClass = getTestCaseClassOrNull(location);
return testCaseClass != null && psiMethod.getContainingClass().isInheritor(testCaseClass, true) && PsiType.VOID.equals(psiMethod.getReturnType());
}