IDEA-89070 Support Guava @VisibleForTesting annotation

This commit is contained in:
peter
2012-07-19 19:12:41 +02:00
parent 1af27c9e0f
commit b81a5ff17f
@@ -71,9 +71,10 @@ public class TestOnlyInspection extends BaseJavaLocalInspectionTool {
return isAnnotatedAsTestOnly(m);
}
private boolean isAnnotatedAsTestOnly(@Nullable PsiMethod m) {
private static boolean isAnnotatedAsTestOnly(@Nullable PsiMethod m) {
if (m == null) return false;
return AnnotationUtil.isAnnotated(m, AnnotationUtil.TEST_ONLY, false);
return AnnotationUtil.isAnnotated(m, AnnotationUtil.TEST_ONLY, false) ||
AnnotationUtil.isAnnotated(m, "com.google.common.annotations.VisibleForTesting", false);
}
private boolean isInsideTestClass(PsiCallExpression e) {