-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlang_51.diff
23 lines (23 loc) · 1.35 KB
/
lang_51.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
diff --git a/src/java/org/apache/commons/lang/BooleanUtils.java b/src/java/org/apache/commons/lang/BooleanUtils.java
index 3fda4ecc..45118c21 100644
--- a/src/java/org/apache/commons/lang/BooleanUtils.java
+++ b/src/java/org/apache/commons/lang/BooleanUtils.java
@@ -647,6 +647,18 @@ public class BooleanUtils {
* @return the boolean value of the string, <code>false</code> if no match
*/
public static boolean toBoolean(String str) {
+ if (Boolean.parseBoolean(System.getProperty("defects4j.instrumentation.enabled"))) { // defects4j.instrumentation
+ try { // defects4j.instrumentation
+ return toBoolean_original(str); // defects4j.instrumentation
+ } catch (StringIndexOutOfBoundsException e) { // defects4j.instrumentation
+ throw new RuntimeException("[Defects4J_BugReport_Violation]"); // defects4j.instrumentation
+ } // defects4j.instrumentation
+ } else { // defects4j.instrumentation
+ return toBoolean_original(str); // defects4j.instrumentation
+ } // defects4j.instrumentation
+ } // defects4j.instrumentation
+
+ public static boolean toBoolean_original(String str) { // defects4j.instrumentation
// Previously used equalsIgnoreCase, which was fast for interned 'true'.
// Non interned 'true' matched 15 times slower.
//