-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlang_50.diff
44 lines (43 loc) · 2.58 KB
/
lang_50.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
43
44
diff --git a/src/java/org/apache/commons/lang/time/FastDateFormat.java b/src/java/org/apache/commons/lang/time/FastDateFormat.java
index 8a26f283..aadd316f 100644
--- a/src/java/org/apache/commons/lang/time/FastDateFormat.java
+++ b/src/java/org/apache/commons/lang/time/FastDateFormat.java
@@ -231,6 +231,18 @@ public class FastDateFormat extends Format {
* @since 2.1
*/
public static FastDateFormat getDateInstance(int style) {
+ if (Boolean.parseBoolean(System.getProperty("defects4j.instrumentation.enabled"))) { // defects4j.instrumentation
+ FastDateFormat date = getDateInstance_original(style); // defects4j.instrumentation
+ if (!date.getLocale().equals(Locale.getDefault())) { // defects4j.instrumentation
+ throw new RuntimeException("[Defects4J_BugReport_Violation]"); // defects4j.instrumentation
+ } // defects4j.instrumentation
+ return date; // defects4j.instrumentation
+ } else { // defects4j.instrumentation
+ return getDateInstance_original(style); // defects4j.instrumentation
+ } // defects4j.instrumentation
+ } // defects4j.instrumentation
+
+ public static FastDateFormat getDateInstance_original(int style) { // defects4j.instrumentation
return getDateInstance(style, null, null);
}
@@ -403,8 +415,19 @@ public class FastDateFormat extends Format {
* pattern defined
* @since 2.1
*/
- public static FastDateFormat getDateTimeInstance(
- int dateStyle, int timeStyle) {
+ public static FastDateFormat getDateTimeInstance(int dateStyle, int timeStyle) { // defects4j.instrumentation
+ if (Boolean.parseBoolean(System.getProperty("defects4j.instrumentation.enabled"))) { // defects4j.instrumentation
+ FastDateFormat date = getDateTimeInstance_original(dateStyle, timeStyle); // defects4j.instrumentation
+ if (!date.getLocale().equals(Locale.getDefault())) { // defects4j.instrumentation
+ throw new RuntimeException("[Defects4J_BugReport_Violation]"); // defects4j.instrumentation
+ } // defects4j.instrumentation
+ return date; // defects4j.instrumentation
+ } else { // defects4j.instrumentation
+ return getDateTimeInstance_original(dateStyle, timeStyle); // defects4j.instrumentation
+ } // defects4j.instrumentation
+ } // defects4j.instrumentation
+
+ public static FastDateFormat getDateTimeInstance_original(int dateStyle, int timeStyle) { // defects4j.instrumentation
return getDateTimeInstance(dateStyle, timeStyle, null, null);
}