spotbugs icon indicating copy to clipboard operation
spotbugs copied to clipboard

The new feature to filter by annotations does not seems to work

Open sergeykad opened this issue 2 years ago • 1 comments

Spotbugs 4.8.0 introduced the ability to filter classes based on their annotations. I added a simple filter to exclude all generated classes, but it doesn't seem to be working. I couldn't find any examples of how to use this feature, so I may be doing something wrong.

Other filters that I omitted from the snippet below are working, so the filter file is loading successfully.

https://github.com/spotbugs/spotbugs/blob/4.8.0/CHANGELOG.md#added

<?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/4.8.0/spotbugs/etc/findbugsfilter.xsd">
    <Match>
        <Annotation name="javax.annotation.processing.Generated"/>
    </Match>
    <Match>
        <Annotation name="javax.annotation.Generated"/>
    </Match>
</FindBugsFilter>

Some related issues: https://github.com/spotbugs/spotbugs/issues/543 https://github.com/spotbugs/spotbugs/issues/1385 https://github.com/spotbugs/spotbugs/pull/2395

sergeykad avatar Nov 09 '23 14:11 sergeykad

Thanks for opening your first issue here! :smiley: Please check our contributing guideline. Especially when you report a problem, make sure you share a Minimal, Complete, and Verifiable example to reproduce it in this issue.

welcome[bot] avatar Nov 09 '23 14:11 welcome[bot]