-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlang_45.diff
24 lines (24 loc) · 1.43 KB
/
lang_45.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/java/org/apache/commons/lang/WordUtils.java b/src/java/org/apache/commons/lang/WordUtils.java
index 42bd883e..d96deea5 100644
--- a/src/java/org/apache/commons/lang/WordUtils.java
+++ b/src/java/org/apache/commons/lang/WordUtils.java
@@ -603,6 +603,19 @@ public class WordUtils {
* @since 2.4
*/
public static String abbreviate(String str, int lower, int upper, String appendToEnd) {
+ if (Boolean.parseBoolean(System.getProperty("defects4j.instrumentation.enabled")) // defects4j.instrumentation
+ && (str != null) && (lower > str.length())) { // defects4j.instrumentation
+ try { // defects4j.instrumentation
+ return abbreviate_orig(str, lower, upper, appendToEnd); // defects4j.instrumentation
+ } catch (StringIndexOutOfBoundsException e) { // defects4j.instrumentation
+ throw new RuntimeException("[Defects4J_BugReport_Violation]"); // defects4j.instrumentation
+ } // defects4j.instrumentation
+ } else { // defects4j.instrumentation
+ return abbreviate_orig(str, lower, upper, appendToEnd); // defects4j.instrumentation
+ } // defects4j.instrumentation
+ } // defects4j.instrumentation
+
+ public static String abbreviate_orig(String str, int lower, int upper, String appendToEnd) { // defects4j.instrumentation
// initial parameter checks
if (str == null) {
return null;