void (InspectionManager manager, PsiClass psiClass, String methodName, PsiAnnotationMemberValue value, List<ProblemDescriptor> problemDescriptors, boolean onTheFly) { LOGGER.debug("Found dependsOnMethods with text: " + methodName); if (!methodName.isEmpty() && methodName.charAt(methodName.length() - 1) == ')') { LOGGER.debug("dependsOnMethods contains ()" + psiClass.getName()); // TODO Add quick fix for removing brackets on annotation String template = TestngBundle.message("inspection.depends.on.method.check", methodName); problemDescriptors.add(manager.createProblemDescriptor( value, template, (LocalQuickFix)null, ProblemHighlightType.LIKE_UNKNOWN_SYMBOL, onTheFly)); } else { final String configAnnotation = TestNGUtil.getConfigAnnotation(PsiTreeUtil.getParentOfType(value, PsiMethod.class)); final PsiMethod[] foundMethods; if (methodName.endsWith("*")) { final String methodNameMask = StringUtil.trimEnd(methodName, "*"); final List<PsiMethod> methods = ContainerUtil.filter(psiClass.getMethods(), method -> method.getName().startsWith(methodNameMask)); foundMethods = methods.toArray(PsiMethod.EMPTY_ARRAY); } else { foundMethods = psiClass.findMethodsByName(methodName, true); } if (foundMethods.length == 0) { LOGGER.debug("dependsOnMethods method doesn't exist:" + methodName); problemDescriptors.add(manager.createProblemDescriptor( value, TestngBundle.message("inspection.depends.on.method.unknown.method.problem", methodName), (LocalQuickFix)null, ProblemHighlightType.LIKE_UNKNOWN_SYMBOL, onTheFly)); } else { boolean hasTestsOrConfigs = false; for (PsiMethod foundMethod : foundMethods) { if (configAnnotation != null) { hasTestsOrConfigs |= AnnotationUtil.isAnnotated(foundMethod, configAnnotation, AnnotationUtil.CHECK_HIERARCHY); } else { hasTestsOrConfigs |= TestNGUtil.hasTest(foundMethod); } } if (!hasTestsOrConfigs) { String template = configAnnotation == null ? TestngBundle.message("inspection.depends.on.method.is.not.test", methodName) : TestngBundle.message("inspection.depends.on.method.is.not.annotated", methodName, configAnnotation); problemDescriptors.add(manager.createProblemDescriptor( value, template, (LocalQuickFix)null, ProblemHighlightType.LIKE_UNKNOWN_SYMBOL, onTheFly)); } } } }