Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/reflectionForUnavailableAnnotation/afterWithoutRetentionAnnotation.java
Andrey.Cherkasov 8c36219f10 [java-inspection] ReflectionForUnavailableAnnotation: provide fix (IDEA-260164)
GitOrigin-RevId: f61a4cfa1afe3ae0fd425f51612acc20e92cfdd4
2021-09-24 22:05:53 +00:00

17 lines
464 B
Java

// "Annotate annotation 'Test' as @Retention" "true"
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.reflect.Method;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@interface Test {
}
class Main {
private static boolean hasTestAnnotation(Method method) {
return method.getAnnotation(Test.class) != null;
}
}