You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was upgrading error-prone to 2.31.0 on a branch for a project and it started reporting both DefaultCharset and FormatStringAnnotation violations in a module.
The former were expected and valid but the latter left me scratching my head as the FormatStringAnnotation checker was not modified between the versions afaict.
I tried reproducing the FormatStringAnnotation violations in an error-prone unit test but the code was passing the check just fine.
Then I tried to reproduce the whole scenario in an error-prone integration test and was successful, so I have pushed the test code here: XN137#1
note:
it looks like after an ERROR has been reported by UnusedVariable, the symbol flags are different in subsequent files and the EFFECTIVELY_FINAL flag is no longer set and so FormatStringAnnotation is reporting "phantom violations"
the symbol flags stay the same when UnusedVariable is set to WARN
the symbol flags stay the same when the file comes before the file that contains the UnusedVariableERROR violation
in the IT I have replaced DefaultCharset with UnusedVariable to show its not related to DefaultLocale / String.format having any shared state with FormatStringAnnotation
please take a look and let me know whether this is expected behavior in errorprone (or javac) or a potential bug?
If the former, maybe this should be documented somewhere as it can be really confusing if checker B starts reporting "unjustified" violations just because checker A has already reported an ERROR.
sorry in case i missed something obvious that would explain this behavior.
The text was updated successfully, but these errors were encountered:
I was upgrading error-prone to 2.31.0 on a branch for a project and it started reporting both
DefaultCharset
andFormatStringAnnotation
violations in a module.The former were expected and valid but the latter left me scratching my head as the
FormatStringAnnotation
checker was not modified between the versions afaict.I tried reproducing the
FormatStringAnnotation
violations in an error-prone unit test but the code was passing the check just fine.Then I tried to reproduce the whole scenario in an error-prone integration test and was successful, so I have pushed the test code here:
XN137#1
note:
ERROR
has been reported byUnusedVariable
, the symbol flags are different in subsequent files and theEFFECTIVELY_FINAL
flag is no longer set and soFormatStringAnnotation
is reporting "phantom violations"UnusedVariable
is set toWARN
UnusedVariable
ERROR
violationDefaultCharset
withUnusedVariable
to show its not related toDefaultLocale
/String.format
having any shared state withFormatStringAnnotation
please take a look and let me know whether this is expected behavior in errorprone (or javac) or a potential bug?
If the former, maybe this should be documented somewhere as it can be really confusing if checker B starts reporting "unjustified" violations just because checker A has already reported an ERROR.
sorry in case i missed something obvious that would explain this behavior.
The text was updated successfully, but these errors were encountered: