@Override public void visitMethod(@NotNull PsiMethod method) { super.visitMethod(method); final PsiCodeBlock body = method.getBody(); if (body == null) { return; } if (method.getNameIdentifier() == null) { return; } final PsiMethod leastConcreteSuperMethod = getLeastConcreteSuperMethod(method); if (leastConcreteSuperMethod == null) { return; } final PsiClass objectClass = ClassUtils.findObjectClass(method); final PsiMethod[] superMethods = method.findSuperMethods(objectClass); if (superMethods.length > 0) { return; } if (ignoreEmptySuperMethods) { final PsiMethod superMethod = (PsiMethod) leastConcreteSuperMethod.getNavigationElement(); if (MethodUtils.isTrivial(superMethod, true)) { return; } } if (onlyReportWhenAnnotated) { if (!AnnotationUtil.isAnnotated(leastConcreteSuperMethod, annotations)) { return; } } if (containsSuperCall(body, leastConcreteSuperMethod)) { return; } registerMethodError(method); }
@Override public void visitMethod(@NotNull PsiMethod method) { super.visitMethod(method); final String name = method.getName(); if (!PsiKeyword.ASSERT.equals(name)) { return; } registerMethodError(method); }
@Override public void visitMethod(@NotNull PsiMethod method) { super.visitMethod(method); if (!method.hasModifierProperty(PsiModifier.STATIC)) { return; } final String name = method.getName(); if (isValid(name)) { return; } registerMethodError(method, name); }
@Override public void visitMethod(@NotNull PsiMethod method) { super.visitMethod(method); if (method.isConstructor() || method.hasModifierProperty(PsiModifier.STATIC)) { return; } if (method.hasModifierProperty(PsiModifier.NATIVE) && isInspectionEnabled("NativeMethodNamingConvention", method)) { return; } final PsiIdentifier nameIdentifier = method.getNameIdentifier(); if (nameIdentifier == null) { return; } if (TestUtils.isRunnable(method)) { if (TestUtils.isJUnit4TestMethod(method) && isInspectionEnabled("JUnit4MethodNamingConvention", method)) { return; } if (TestUtils.isJUnit3TestMethod(method) && isInspectionEnabled("JUnit3MethodNamingConvention", method)) { return; } } if (isTestNGTestMethod(method) && isInspectionEnabled("TestNGMethodNamingConvention", method)) { return; } final String name = method.getName(); if (isValid(name)) { return; } if (!isOnTheFly() && MethodUtils.hasSuper(method)) { return; } if (LibraryUtil.isOverrideOfLibraryMethod(method)) { return; } registerMethodError(method, name); }
@Override public void visitMethod(PsiMethod method) { super.visitMethod(method); final String name = method.getName(); if (!name.startsWith("test")) { return; } if (!TestUtils.isRunnable(method)) { return; } if (TestUtils.isAnnotatedTestMethod(method)) { return; } final PsiClass containingClass = method.getContainingClass(); if (TestUtils.isJUnitTestClass(containingClass)) { return; } if (!containsJUnit4Annotation(containingClass)) { return; } registerMethodError(method); }