Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Attachment actions
Unintended behavior
View staffing
Description
Component used: Annotation Version used: 1.2.0
With the following class:
And the following usages in a class in the same package:
Expected
All
@VisibleForTesting
violations are treated the same by lint, either as errors or warnings. In this case I expect to see errors/warnings raised on:Actual
A
@VisibleForTesting(otherwise = NONE)
violation seems to generate a lint error, while all other violations generate warnings. Why is there this asymmetry?The wording of the warning/errors are also slightly different:
Violating
otherwise = PROTECTED
andotherwise = PACKAGE_PRIVATE
also generates warnings with wording similar to violatingPRIVATE
:I noticed that the
NONE
error is identical to that produced byRestrictTo(TESTS)
:Maybe this inconsistency in the
@VisibleForTesting
lint handling is an artefact of delegating the implementation ofotherwise = NONE
to@RestrictTo(TESTS)
(complete guess!).