-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlang_22.diff
24 lines (24 loc) · 1.52 KB
/
lang_22.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/lang3/math/Fraction.java b/src/main/java/org/apache/commons/lang3/math/Fraction.java
index b36a156a..a8bccfa2 100644
--- a/src/main/java/org/apache/commons/lang3/math/Fraction.java
+++ b/src/main/java/org/apache/commons/lang3/math/Fraction.java
@@ -579,6 +579,19 @@ public final class Fraction extends Number implements Comparable<Fraction> {
* @return the greatest common divisor, never zero
*/
private static int greatestCommonDivisor(int u, int v) {
+ if (Boolean.parseBoolean(System.getProperty("defects4j.instrumentation.enabled"))) { // defects4j.instrumentation
+ int returnValue; // defects4j.instrumentation
+ returnValue = greatestCommonDivisor_original(u, v); // defects4j.instrumentation
+ if (u == Integer.MIN_VALUE && v == 2 && returnValue != 2) { // defects4j.instrumentation
+ throw new RuntimeException("[Defects4J_BugReport_Violation]"); // defects4j.instrumentation
+ } // defects4j.instrumentation
+ return returnValue; // defects4j.instrumentation
+ } else { // defects4j.instrumentation
+ return greatestCommonDivisor_original(u, v); // defects4j.instrumentation
+ } // defects4j.instrumentation
+ } // defects4j.instrumentation
+
+ private static int greatestCommonDivisor_original(int u, int v) { // defects4j.instrumentation
// From Commons Math:
//if either operand is abs 1, return 1:
if (Math.abs(u) <= 1 || Math.abs(v) <= 1) {