diff --git a/infer/tests/codetoanalyze/java/checkers/Makefile b/infer/tests/codetoanalyze/java/checkers/Makefile index d1d84713c..a5db2f7ca 100644 --- a/infer/tests/codetoanalyze/java/checkers/Makefile +++ b/infer/tests/codetoanalyze/java/checkers/Makefile @@ -11,16 +11,16 @@ ANALYZER = checkers FILES = \ Branch.java \ - FragmentRetainsViewExample.java \ ExpensiveCallExample.java \ - ImmutableCast.java \ ExpensiveInheritanceExample.java \ - NoAllocationExample.java \ ExpensiveInterfaceExample.java \ - PrintfArgsChecker.java \ ExpensiveSubtypingExample.java \ - TraceCallSequence.java \ FragmentDoesNotRetainViewExample.java \ + FragmentRetainsViewExample.java \ + ImmutableCast.java \ + NoAllocationExample.java \ + PrintfArgsChecker.java \ + TraceCallSequence.java \ TwoCheckersExample.java compile: diff --git a/infer/tests/codetoanalyze/java/infer/GuardedByExample.java b/infer/tests/codetoanalyze/java/infer/GuardedByExample.java index 4875814fd..ce63fec89 100644 --- a/infer/tests/codetoanalyze/java/infer/GuardedByExample.java +++ b/infer/tests/codetoanalyze/java/infer/GuardedByExample.java @@ -354,4 +354,20 @@ public class GuardedByExample { } */ + int n; + + public void FP_withloop2() { + synchronized (mLock) { + for (int i = 0; i<=n; i++) { + f = 42; + } + } + } + + public void withoutloop2() { + synchronized (mLock) { + f = 42; + } + } + } diff --git a/infer/tests/codetoanalyze/java/infer/issues.exp b/infer/tests/codetoanalyze/java/infer/issues.exp index e626e0bb6..c5e6f3888 100644 --- a/infer/tests/codetoanalyze/java/infer/issues.exp +++ b/infer/tests/codetoanalyze/java/infer/issues.exp @@ -74,6 +74,7 @@ FilterOutputStreamLeaks.java, void FilterOutputStreamLeaks.printStreamNotClosedA GuardedByExample.java, Object GuardedByExample.byRefTrickyBad(), 5, UNSAFE_GUARDED_BY_ACCESS GuardedByExample.java, String GuardedByExample$3.readFromInnerClassBad1(), 2, UNSAFE_GUARDED_BY_ACCESS GuardedByExample.java, String GuardedByExample$4.readFromInnerClassBad2(), 1, UNSAFE_GUARDED_BY_ACCESS +GuardedByExample.java, void GuardedByExample.FP_withloop2(), 3, UNSAFE_GUARDED_BY_ACCESS GuardedByExample.java, void GuardedByExample.readFAfterBlockBad(), 3, UNSAFE_GUARDED_BY_ACCESS GuardedByExample.java, void GuardedByExample.readFBad(), 1, UNSAFE_GUARDED_BY_ACCESS GuardedByExample.java, void GuardedByExample.readFBadWrongAnnotation(), 1, UNSAFE_GUARDED_BY_ACCESS