-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmath_70.diff
24 lines (23 loc) · 1.59 KB
/
math_70.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/math/analysis/solvers/BisectionSolver.java b/src/main/java/org/apache/commons/math/analysis/solvers/BisectionSolver.java
index 3f669271a..24d163a81 100644
--- a/src/main/java/org/apache/commons/math/analysis/solvers/BisectionSolver.java
+++ b/src/main/java/org/apache/commons/math/analysis/solvers/BisectionSolver.java
@@ -69,6 +69,19 @@ public class BisectionSolver extends UnivariateRealSolverImpl {
/** {@inheritDoc} */
public double solve(final UnivariateRealFunction f, double min, double max, double initial)
throws MaxIterationsExceededException, FunctionEvaluationException {
+ if (Boolean.parseBoolean(System.getProperty("defects4j.instrumentation.enabled"))) { // defects4j.instrumentation
+ try { // defects4j.instrumentation
+ return solve_orig(f, min, max, initial); // defects4j.instrumentation
+ } catch (NullPointerException e) { // defects4j.instrumentation
+ throw new RuntimeException("[Defects4J_BugReport_Violation]"); // defects4j.instrumentation
+ } // defects4j.instrumentation
+ } else { // defects4j.instrumentation
+ return solve_orig(f, min, max, initial); // defects4j.instrumentation
+ } // defects4j.instrumentation
+ } // defects4j.instrumentation
+
+ public double solve_orig(final UnivariateRealFunction f, double min, double max, double initial) // defects4j.instrumentation
+ throws MaxIterationsExceededException, FunctionEvaluationException { // defects4j.instrumentation
return solve(min, max);
}