-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmath_2.diff
24 lines (23 loc) · 1.45 KB
/
math_2.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
diff --git a/src/main/java/org/apache/commons/math3/distribution/HypergeometricDistribution.java b/src/main/java/org/apache/commons/math3/distribution/HypergeometricDistribution.java
index 27691272f..3f004c9fd 100644
--- a/src/main/java/org/apache/commons/math3/distribution/HypergeometricDistribution.java
+++ b/src/main/java/org/apache/commons/math3/distribution/HypergeometricDistribution.java
@@ -110,6 +110,19 @@ public class HypergeometricDistribution extends AbstractIntegerDistribution {
this.sampleSize = sampleSize;
}
+ @Override // defects4j.instrumentation
+ public int sample() { // defects4j.instrumentation
+ if (Boolean.parseBoolean(System.getProperty("defects4j.instrumentation.enabled"))) { // defects4j.instrumentation
+ int returnValue = super.sample(); // defects4j.instrumentation
+ if (returnValue < this.getSupportLowerBound() || returnValue > this.getSupportUpperBound()) { // defects4j.instrumentation
+ throw new RuntimeException("[Defects4J_BugReport_Violation]"); // defects4j.instrumentation
+ } // defects4j.instrumentation
+ return returnValue; // defects4j.instrumentation
+ } else { // defects4j.instrumentation
+ return super.sample(); // defects4j.instrumentation
+ } // defects4j.instrumentation
+ } // defects4j.instrumentation
+
/** {@inheritDoc} */
public double cumulativeProbability(int x) {
double ret;