// Path: src/main/java/me/champeau/gradle/japicmp/report/stdrules/BinaryIncompatibleRule.java
// public class BinaryIncompatibleRule extends AbstractRecordingSeenMembers {
//     private final Severity severity;
// 
//     public BinaryIncompatibleRule(final Severity severity) {
//         this.severity = severity;
//     }
// 
//     public BinaryIncompatibleRule() {
//         this(Severity.error);
//     }
// 
//     @Override
//     public Violation maybeAddViolation(final JApiCompatibility member) {
//         if (!member.isBinaryCompatible()) {
//             return Violation.notBinaryCompatible(member, severity);
//         }
//         return null;
//     }
// }
// 
// Path: src/main/java/me/champeau/gradle/japicmp/report/stdrules/RecordSeenMembersSetup.java
// public class RecordSeenMembersSetup implements SetupRule {
//     static final String SEEN = RecordSeenMembersSetup.class.getName();
// 
//     @Override
//     public void execute(final ViolationCheckContext violationCheckContext) {
//         violationCheckContext.putUserData(SEEN, new HashSet<JApiCompatibility>());
//     }
// }
// 
// Path: src/main/java/me/champeau/gradle/japicmp/report/stdrules/SourceCompatibleRule.java
// public class SourceCompatibleRule extends AbstractRecordingSeenMembers {
//     private final Severity severity;
//     private final String message;
// 
//     public SourceCompatibleRule(final Severity severity, String message) {
//         this.severity = severity;
//         this.message = message;
//     }
// 
//     public SourceCompatibleRule() {
//         this(Severity.warning, "is source compatible");
//     }
// 
//     @Override
//     public Violation maybeAddViolation(final JApiCompatibility member) {
//         if (member.isSourceCompatible()) {
//             return Violation.any(member, severity, message);
//         }
//         return null;
//     }
// }
// 
// Path: src/main/java/me/champeau/gradle/japicmp/report/stdrules/UnchangedMemberRule.java
// public class UnchangedMemberRule extends AbstractRecordingSeenMembers {
// 
//     @Override
//     public Violation maybeAddViolation(final JApiCompatibility member) {
//         Set<JApiCompatibility> seen = getContext().getUserData(RecordSeenMembersSetup.SEEN);
//         seen.add(member);
//         return null;
//     }
// }


import japicmp.model.JApiChangeStatus;
import japicmp.model.JApiClass;
import japicmp.model.JApiCompatibility;
import japicmp.model.JApiCompatibilityChange;
import japicmp.model.JApiConstructor;
import japicmp.model.JApiField;
import japicmp.model.JApiHasChangeStatus;
import japicmp.model.JApiImplementedInterface;
import japicmp.model.JApiMethod;
import me.champeau.gradle.japicmp.report.stdrules.BinaryIncompatibleRule;
import me.champeau.gradle.japicmp.report.stdrules.RecordSeenMembersSetup;
import me.champeau.gradle.japicmp.report.stdrules.SourceCompatibleRule;
import me.champeau.gradle.japicmp.report.stdrules.UnchangedMemberRule;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.regex.Pattern;
    }

    public Map<String, List<Violation>> toViolations(List<JApiClass> classes) {
        addDefaultRuleIfNotConfigured();
        Context ctx = new Context(violationTransformers);
        for (SetupRule setupRule : setupRules) {
            setupRule.execute(ctx);
        }
        injectContextIntoRules(ctx);
        for (JApiClass aClass : classes) {
            maybeProcess(aClass, ctx);
        }
        for (PostProcessViolationsRule postProcessViolationsRule : postProcessRules) {
            postProcessViolationsRule.execute(ctx);
        }
        return ctx.violations;
    }

    private void addDefaultRuleIfNotConfigured() {
        if (setupRules.isEmpty()
                && postProcessRules.isEmpty()
                && apiCompatibilityRules.isEmpty()
                && statusRules.isEmpty()
                && genericRules.isEmpty()) {
            addDefaultRules();
        }
    }

    public void addDefaultRules() {
        setupRules.add(new RecordSeenMembersSetup());
// Path: src/main/java/me/champeau/gradle/japicmp/report/stdrules/BinaryIncompatibleRule.java
// public class BinaryIncompatibleRule extends AbstractRecordingSeenMembers {
//     private final Severity severity;
// 
//     public BinaryIncompatibleRule(final Severity severity) {
//         this.severity = severity;
//     }
// 
//     public BinaryIncompatibleRule() {
//         this(Severity.error);
//     }
// 
//     @Override
//     public Violation maybeAddViolation(final JApiCompatibility member) {
//         if (!member.isBinaryCompatible()) {
//             return Violation.notBinaryCompatible(member, severity);
//         }
//         return null;
//     }
// }
// 
// Path: src/main/java/me/champeau/gradle/japicmp/report/stdrules/RecordSeenMembersSetup.java
// public class RecordSeenMembersSetup implements SetupRule {
//     static final String SEEN = RecordSeenMembersSetup.class.getName();
// 
//     @Override
//     public void execute(final ViolationCheckContext violationCheckContext) {
//         violationCheckContext.putUserData(SEEN, new HashSet<JApiCompatibility>());
//     }
// }
// 
// Path: src/main/java/me/champeau/gradle/japicmp/report/stdrules/SourceCompatibleRule.java
// public class SourceCompatibleRule extends AbstractRecordingSeenMembers {
//     private final Severity severity;
//     private final String message;
// 
//     public SourceCompatibleRule(final Severity severity, String message) {
//         this.severity = severity;
//         this.message = message;
//     }
// 
//     public SourceCompatibleRule() {
//         this(Severity.warning, "is source compatible");
//     }
// 
//     @Override
//     public Violation maybeAddViolation(final JApiCompatibility member) {
//         if (member.isSourceCompatible()) {
//             return Violation.any(member, severity, message);
//         }
//         return null;
//     }
// }
// 
// Path: src/main/java/me/champeau/gradle/japicmp/report/stdrules/UnchangedMemberRule.java
// public class UnchangedMemberRule extends AbstractRecordingSeenMembers {
// 
//     @Override
//     public Violation maybeAddViolation(final JApiCompatibility member) {
//         Set<JApiCompatibility> seen = getContext().getUserData(RecordSeenMembersSetup.SEEN);
//         seen.add(member);
//         return null;
//     }
// }


// Path: src/main/java/me/champeau/gradle/japicmp/report/ViolationsGenerator.java
import japicmp.model.JApiChangeStatus;
import japicmp.model.JApiClass;
import japicmp.model.JApiCompatibility;
import japicmp.model.JApiCompatibilityChange;
import japicmp.model.JApiConstructor;
import japicmp.model.JApiField;
import japicmp.model.JApiHasChangeStatus;
import japicmp.model.JApiImplementedInterface;
import japicmp.model.JApiMethod;
import me.champeau.gradle.japicmp.report.stdrules.BinaryIncompatibleRule;
import me.champeau.gradle.japicmp.report.stdrules.RecordSeenMembersSetup;
import me.champeau.gradle.japicmp.report.stdrules.SourceCompatibleRule;
import me.champeau.gradle.japicmp.report.stdrules.UnchangedMemberRule;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.regex.Pattern;

    }

    public Map<String, List<Violation>> toViolations(List<JApiClass> classes) {
        addDefaultRuleIfNotConfigured();
        Context ctx = new Context(violationTransformers);
        for (SetupRule setupRule : setupRules) {
            setupRule.execute(ctx);
        }
        injectContextIntoRules(ctx);
        for (JApiClass aClass : classes) {
            maybeProcess(aClass, ctx);
        }
        for (PostProcessViolationsRule postProcessViolationsRule : postProcessRules) {
            postProcessViolationsRule.execute(ctx);
        }
        return ctx.violations;
    }

    private void addDefaultRuleIfNotConfigured() {
        if (setupRules.isEmpty()
                && postProcessRules.isEmpty()
                && apiCompatibilityRules.isEmpty()
                && statusRules.isEmpty()
                && genericRules.isEmpty()) {
            addDefaultRules();
        }
    }

    public void addDefaultRules() {
        setupRules.add(new RecordSeenMembersSetup());
        addRule(JApiChangeStatus.NEW, new SourceCompatibleRule(Severity.info, "has been added in source compatible way"));