<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter
        xmlns="https://github.com/spotbugs/filter/3.0.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubusercontent.com/spotbugs/spotbugs/3.1.0/spotbugs/etc/findbugsfilter.xsd">

    <!-- I'm reasonably confident that the singleton pattern isn't exposing internal representation -->
    <And>
        <Class name="dev.openfeature.sdk.OpenFeatureAPI"/>
        <Bug pattern="MS_EXPOSE_REP"/>
    </And>
    <!-- evaluation context and hooks are mutable if mutable impl is used -->
    <And>
        <Class name="dev.openfeature.sdk.OpenFeatureClient"/>
        <Bug pattern="EI_EXPOSE_REP"/>
    </And>
    <And>
        <Class name="dev.openfeature.sdk.OpenFeatureClient"/>
        <Bug pattern="EI_EXPOSE_REP2"/>
    </And>
    <And>
        <Class name="dev.openfeature.sdk.OpenFeatureAPI"/>
        <Bug pattern="EI_EXPOSE_REP"/>
    </And>
    <And>
        <Class name="dev.openfeature.sdk.OpenFeatureAPI"/>
        <Bug pattern="EI_EXPOSE_REP2"/>
    </And>
    <And>
        Added in spotbugs 4.8.0 - EventProvider shares a name with something from the standard lib (confusing), but change would be breaking
        <Class name="dev.openfeature.sdk.EventProvider"/>
        <Bug pattern="PI_DO_NOT_REUSE_PUBLIC_IDENTIFIERS_CLASS_NAMES"/>
    </And>
    <And>
        Added in spotbugs 4.8.0 - Metadata shares a name with something from the standard lib (confusing), but change would be breaking
        <Class name="dev.openfeature.sdk.Metadata"/>
        <Bug pattern="PI_DO_NOT_REUSE_PUBLIC_IDENTIFIERS_CLASS_NAMES"/>
    </And>
    <And>
        Added in spotbugs 4.8.0 - Reason shares a name with something from the standard lib (confusing), but change would be breaking
        <Class name="dev.openfeature.sdk.Reason"/>
        <Bug pattern="PI_DO_NOT_REUSE_PUBLIC_IDENTIFIERS_CLASS_NAMES"/>
    </And>
    <And>
        Added in spotbugs 4.8.0 - FlagValueType.STRING shares a name with something from the standard lib (confusing), but change would be breaking
        <Class name="dev.openfeature.sdk.FlagValueType"/>
        <Bug pattern="PI_DO_NOT_REUSE_PUBLIC_IDENTIFIERS_FIELD_NAMES"/>
    </And>

    <!-- Test class that should be excluded -->
    <Match>
        <Class name="dev.openfeature.sdk.DoSomethingProvider"/>
    </Match>
    <!-- All bugs in test classes, except for JUnit-specific bugs -->
    <Match>
        <Class name="~.*\.*Test" />
        <Not>
            <Bug code="IJU" />
        </Not>
    </Match>
</FindBugsFilter>