Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/reflectionForUnavailableAnnotation/afterWithRetentionAnnotation.java
Andrey.Cherkasov 48d2830934 [java-inspections] ReflectionForUnavailableAnnotation: provide fix if the @Retention annotation is presented
(IJ-CR-14614)

GitOrigin-RevId: 39fe3f01bb989cfee948773cfabc748fbd0eeebd
2021-10-18 20:45:03 +00:00

17 lines
489 B
Java

// "Annotate annotation 'Test' as @Retention(RetentionPolicy.RUNTIME)" "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;
}
}