mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
Java: Added inline test expectations for java/visible-for-testing-abuse
This commit is contained in:
@@ -1 +1,2 @@
|
||||
Violations of Best Practice/Implementation Hiding/VisibleForTestingAbuse.ql
|
||||
query: Violations of Best Practice/Implementation Hiding/VisibleForTestingAbuse.ql
|
||||
postprocess: utils/test/InlineExpectationsTestQuery.ql
|
||||
|
||||
@@ -5,6 +5,6 @@ import packagetwo.Annotated;
|
||||
public class SourcePackage extends Annotated {
|
||||
void f() {
|
||||
AnnotatedClass a = new AnnotatedClass(); // COMPLIANT - same package
|
||||
String s1 = Annotated.m1; // NON_COMPLIANT
|
||||
String s1 = Annotated.m1; // $ Alert
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,9 +4,9 @@ import packageone.*;
|
||||
|
||||
public class Source {
|
||||
void f() {
|
||||
int i = Annotated.f(); // NON_COMPLIANT
|
||||
String s = Annotated.m; // NON_COMPLIANT
|
||||
AnnotatedClass a = new AnnotatedClass(); // NON_COMPLIANT
|
||||
int i = Annotated.f(); // $ Alert
|
||||
String s = Annotated.m; // $ Alert
|
||||
AnnotatedClass a = new AnnotatedClass(); // $ Alert
|
||||
String s1 = Annotated.m1; // COMPLIANT - same package
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user