-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmath_56.diff
29 lines (26 loc) · 1.41 KB
/
math_56.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
diff --git a/src/main/java/org/apache/commons/math/util/MultidimensionalCounter.java b/src/main/java/org/apache/commons/math/util/MultidimensionalCounter.java
index 56c9ffebc..fd73ad71d 100644
--- a/src/main/java/org/apache/commons/math/util/MultidimensionalCounter.java
+++ b/src/main/java/org/apache/commons/math/util/MultidimensionalCounter.java
@@ -234,6 +234,11 @@ public class MultidimensionalCounter implements Iterable<Integer> {
indices[i] = idx;
}
+ int correctLastIndex = 0; // defects4j.instrumentation
+ if (Boolean.parseBoolean(System.getProperty("defects4j.instrumentation.enabled"))) { // defects4j.instrumentation
+ correctLastIndex = index - count; // defects4j.instrumentation
+ } // defects4j.instrumentation
+
int idx = 1;
while (count < index) {
count += idx;
@@ -242,6 +247,12 @@ public class MultidimensionalCounter implements Iterable<Integer> {
--idx;
indices[last] = idx;
+ if (Boolean.parseBoolean(System.getProperty("defects4j.instrumentation.enabled"))) { // defects4j.instrumentation
+ if (indices[last] != correctLastIndex) { // defects4j.instrumentation
+ throw new RuntimeException("[Defects4J_BugReport_Violation]"); // defects4j.instrumentation
+ } // defects4j.instrumentation
+ } // defects4j.instrumentation
+
return indices;
}