class RedosAnnotationDetector implements Detector {

    private static final String REDOS_TYPE = "REDOS";

    private static final String REGEX_ANNOTATION_TYPES = "Ljavax/validation/constraints/Pattern;";

    private BugReporter bugReporter;

    public RedosAnnotationDetector(BugReporter bugReporter) {
        this.bugReporter = bugReporter;
    }

    @Override
    public void visitClassContext(ClassContext classContext) {<FILL_FUNCTION_BODY>}

    @Override
    public void report() {

    }

}

        JavaClass javaClass = classContext.getJavaClass();
        field : for (Field f : javaClass.getFields()) {

            for (AnnotationEntry ae : f.getAnnotationEntries()) {

                if (REGEX_ANNOTATION_TYPES.equals(ae.getAnnotationType())) {

                    ElementValuePair[] values = ae.getElementValuePairs();

                    for(ElementValuePair valuePair : values) {
                        if("regexp".equals(valuePair.getNameString())) {

                            String regex = valuePair.getValue().stringifyValue();

                            RegexRedosAnalyzer analyzer = new RegexRedosAnalyzer();
                            analyzer.analyseRegexString(regex);

                            //Reporting the issue
                            if (analyzer.isVulnerable()) {

                                bugReporter.reportBug(new BugInstance(this, REDOS_TYPE, Priorities.LOW_PRIORITY) //
                                        .addClass(javaClass)
                                        .addField(javaClass.getClassName(), f.getName(), f.getSignature(), false));
                            }
                        }
                    }



                    continue field; //No need to check the other annotation, We already found the one.
                }
            }
        }
    
<no_super_class>