File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
src/Violations of Best Practice/Implementation Hiding
test/query-tests/VisibleForTestingAbuse/packagetwo Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 95
95
not e .getEnclosingCallable ( ) instanceof LikelyTestMethod and
96
96
// not when the accessing method or any enclosing method is @VisibleForTesting (test-to-test communication)
97
97
not isWithinVisibleForTestingContext ( e .getEnclosingCallable ( ) ) and
98
+ // not when used in annotation contexts
99
+ not e .getParent * ( ) instanceof Annotation and
98
100
// also omit our own ql unit test where it is acceptable
99
101
not e .getEnclosingCallable ( )
100
102
.getFile ( )
Original file line number Diff line number Diff line change
1
+ package packagetwo ;
2
+
3
+ import packageone .*;
4
+
5
+ @interface Range {
6
+ int min () default 0 ;
7
+ int max () default 100 ;
8
+ }
9
+
10
+ public class UseWithinAnnotation {
11
+ @ VisibleForTesting
12
+ static final int MAX_LISTING_LENGTH_MIN = 1 ;
13
+ @ VisibleForTesting
14
+ static final int MAX_LISTING_LENGTH_MAX = 1000 ;
15
+
16
+ @ Range (min = MAX_LISTING_LENGTH_MIN , max = MAX_LISTING_LENGTH_MAX )
17
+ private int maxListingLength = MAX_LISTING_LENGTH_MAX ;
18
+ }
You can’t perform that action at this time.
0 commit comments