-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlang_61.diff
42 lines (42 loc) · 2.48 KB
/
lang_61.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
33
34
35
36
37
38
39
40
41
42
diff --git a/src/java/org/apache/commons/lang/text/StrBuilder.java b/src/java/org/apache/commons/lang/text/StrBuilder.java
index 0e889892..72db383c 100644
--- a/src/java/org/apache/commons/lang/text/StrBuilder.java
+++ b/src/java/org/apache/commons/lang/text/StrBuilder.java
@@ -1181,6 +1181,18 @@ public class StrBuilder implements Cloneable {
* @return this, to enable chaining
*/
public StrBuilder deleteAll(String str) {
+ if (Boolean.parseBoolean(System.getProperty("defects4j.instrumentation.enabled"))) { // defects4j.instrumentation
+ try { // defects4j.instrumentation
+ return deleteAll_original(str); // defects4j.instrumentation
+ } catch (ArrayIndexOutOfBoundsException e) { // defects4j.instrumentation
+ throw new RuntimeException("[Defects4J_BugReport_Violation]"); // defects4j.instrumentation
+ } // defects4j.instrumentation
+ } else { // defects4j.instrumentation
+ return deleteAll_original(str); // defects4j.instrumentation
+ } // defects4j.instrumentation
+ } // defects4j.instrumentation
+
+ public StrBuilder deleteAll_original(String str) { // defects4j.instrumentation
int len = (str == null ? 0 : str.length());
if (len > 0) {
int index = indexOf(str, 0);
@@ -1328,6 +1340,18 @@ public class StrBuilder implements Cloneable {
* @return this, to enable chaining
*/
public StrBuilder replaceAll(String searchStr, String replaceStr) {
+ if (Boolean.parseBoolean(System.getProperty("defects4j.instrumentation.enabled"))) { // defects4j.instrumentation
+ try { // defects4j.instrumentation
+ return replaceAll_original(searchStr, replaceStr); // defects4j.instrumentation
+ } catch (ArrayIndexOutOfBoundsException e) { // defects4j.instrumentation
+ throw new RuntimeException("[Defects4J_BugReport_Violation]"); // defects4j.instrumentation
+ } // defects4j.instrumentation
+ } else { // defects4j.instrumentation
+ return replaceAll_original(searchStr, replaceStr); // defects4j.instrumentation
+ } // defects4j.instrumentation
+ } // defects4j.instrumentation
+
+ public StrBuilder replaceAll_original(String searchStr, String replaceStr) { // defects4j.instrumentation
int searchLen = (searchStr == null ? 0 : searchStr.length());
if (searchLen > 0) {
int replaceLen = (replaceStr == null ? 0 : replaceStr.length());