-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlang_16.diff
32 lines (32 loc) · 1.96 KB
/
lang_16.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
30
31
32
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 882358f2..84501172 100644
--- a/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
+++ b/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
@@ -442,6 +442,27 @@ 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
+ try { // defects4j.instrumentation
+ return createNumber_original(str); // defects4j.instrumentation
+ } catch (NumberFormatException e) { // defects4j.instrumentation
+ if (str != null && (str.startsWith("0X") || str.startsWith("-0X"))) { // defects4j.instrumentation
+ try { // defects4j.instrumentation
+ Integer.decode(str); // defects4j.instrumentation
+ } catch (NumberFormatException e_decode) { // defects4j.instrumentation
+ throw e; // defects4j.instrumentation
+ } // defects4j.instrumentation
+ throw new RuntimeException("[Defects4J_BugReport_Violation]"); // defects4j.instrumentation
+ } else { // defects4j.instrumentation
+ throw e; // defects4j.instrumentation
+ } // defects4j.instrumentation
+ } // defects4j.instrumentation
+ } else { // defects4j.instrumentation
+ return createNumber_original(str); // defects4j.instrumentation
+ } // defects4j.instrumentation
+ } // defects4j.instrumentation
+
+ public static Number createNumber_original(String str) throws NumberFormatException { // defects4j.instrumentation
if (str == null) {
return null;
}