Error-prone: @SuppressWarnings support for Refaster templates

Created on 19 Feb 2020  路  4Comments  路  Source: google/error-prone

For a given Refaster template it would be nice if client code could use an @SuppressWarnings annotation to suppress a particular match from being reported. I suppose the simplest solution would be to use the Refaster template's fully qualified class name as the ID of the warning.

Most helpful comment

@cushon do you think that this issue is resolved with PR #1517?

All 4 comments

A (not super nice) workaround is to add a comment "inside" the expression that would otherwise be transformed. Any comment will do (e.g. /* No Refaster */), but this doesn't work for e.g. constants :)

@Stephan202 Thanks for the tip.

Similarly I would also have hoped that I can use -Xep:my.refaster.Template:OFF to disable a given Refaster template. But this doesn't appear to work, AFAICT.

@cushon do you think that this issue is resolved with PR #1517?

Was this page helpful?
0 / 5 - 0 ratings