-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlang_7.diff
29 lines (29 loc) · 1.62 KB
/
lang_7.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/lang3/math/NumberUtils.java b/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
index d49da7f4..6fce831f 100644
--- a/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
+++ b/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
@@ -443,6 +443,24 @@ public class NumberUtils {
* @throws NumberFormatException if the value cannot be converted
*/
public static Number createNumber(String str) throws NumberFormatException {
+ if (Boolean.parseBoolean(System.getProperty("defects4j.instrumentation.enabled")) // defects4j.instrumentation
+ && (str != null) && str.startsWith("--")) { // defects4j.instrumentation
+ try {
+ createNumber_orig(str); // NumberFormatException should be thrown // defects4j.instrumentation
+ } catch (Throwable t) {
+ if (t instanceof NumberFormatException) {
+ throw (NumberFormatException) t;
+ } else {
+ throw new RuntimeException("[Defects4J_BugReport_Violation]"); // defects4j.instrumentation
+ }
+ }
+ throw new RuntimeException("[Defects4J_BugReport_Violation]"); // defects4j.instrumentation
+ } else { // defects4j.instrumentation
+ return createNumber_orig(str); // defects4j.instrumentation
+ } // defects4j.instrumentation
+ } // defects4j.instrumentation
+
+ public static Number createNumber_orig(String str) throws NumberFormatException { // defects4j.instrumentation
if (str == null) {
return null;
}