Skip to content

Commit 6ed8950

Browse files
yoffaschackmull
andauthored
Apply suggestions from code review
Co-authored-by: Anders Schack-Mulligen <[email protected]>
1 parent 15953bf commit 6ed8950

File tree

2 files changed

+6
-6
lines changed
  • java/ql/test/library-tests/dataflow/range-analysis-inline

2 files changed

+6
-6
lines changed

java/ql/test/library-tests/dataflow/range-analysis-inline/B.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
public class B {
22
public int forloop() {
33
int result = 0;
4-
for (int i = 0; i < 10; i++) {// $ bound="i in [0..10]" bound="i in [0..9]"
4+
for (int i = 0;
5+
i < 10; // $ bound="i in [0..10]"
6+
i++) { // $ bound="i in [0..9]"
57
result = i; // $ bound="i in [0..9]"
68
}
79
return result; // $ bound="result in [0..9]"

java/ql/test/library-tests/dataflow/range-analysis-inline/range.ql

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55

66
import java
77
import semmle.code.java.dataflow.RangeAnalysis
8-
private import codeql.util.test.InlineExpectationsTest
9-
private import TestUtilities.internal.InlineExpectationsTestImpl
10-
private import Make<Impl> as IET
8+
private import TestUtilities.InlineExpectationsTest as IET
119

1210
module RangeTest implements IET::TestSig {
1311
string getARelevantTag() { result = "bound" }
@@ -29,8 +27,8 @@ module RangeTest implements IET::TestSig {
2927
}
3028

3129
private predicate constrained(Expr e, int lower, int upper) {
32-
lower = min(int delta | bounded(e, any(ZeroBound z), delta, false, _)) and
33-
upper = min(int delta | bounded(e, any(ZeroBound z), delta, true, _))
30+
bounded(e, any(ZeroBound z), lower, false, _) and
31+
bounded(e, any(ZeroBound z), upper, true, _)
3432
}
3533
}
3634

0 commit comments

Comments
 (0)