Java: Exclude @VisibleForTesting-to-@VisibleForTesting access from VisibleForTestingAbuse alerts

This commit is contained in:
Napalys Klicius
2025-08-06 14:57:16 +02:00
parent e4042402bc
commit 225723bfeb
3 changed files with 19 additions and 16 deletions

View File

@@ -6,17 +6,17 @@ public class SourcePackage1 extends Annotated {
@VisibleForTesting
public void f() {
String s1 = Annotated.m1; // $ SPURIOUS: Alert
String s2 = Annotated.m2; // $ SPURIOUS: Alert
String s1 = Annotated.m1;
String s2 = Annotated.m2;
int i2 = Annotated.fPublic(); // $ SPURIOUS: Alert
int i3 = Annotated.fProtected(); // $ SPURIOUS: Alert
int i2 = Annotated.fPublic();
int i3 = Annotated.fProtected();
Runnable lambda = () -> {
String lambdaS1 = Annotated.m1; // $ SPURIOUS: Alert
String lambdaS2 = Annotated.m2; // $ SPURIOUS: Alert
int lambdaI2 = Annotated.fPublic(); // $ SPURIOUS: Alert
int lambdaI3 = Annotated.fProtected(); // $ SPURIOUS: Alert
String lambdaS1 = Annotated.m1;
String lambdaS2 = Annotated.m2;
int lambdaI2 = Annotated.fPublic();
int lambdaI3 = Annotated.fProtected();
};
}
}