-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtime_4.diff
25 lines (25 loc) · 1.48 KB
/
time_4.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
diff --git a/src/main/java/org/joda/time/Partial.java b/src/main/java/org/joda/time/Partial.java
index 0d4edf47..d08dac13 100644
--- a/src/main/java/org/joda/time/Partial.java
+++ b/src/main/java/org/joda/time/Partial.java
@@ -424,6 +424,20 @@ public final class Partial
* @throws IllegalArgumentException if the value is null or invalid
*/
public Partial with(DateTimeFieldType fieldType, int value) {
+ if (Boolean.parseBoolean(System.getProperty("defects4j.instrumentation.enabled"))) { // defects4j.instrumentation
+ Partial result = with_original(fieldType, value); // defects4j.instrumentation
+ try { // defects4j.instrumentation
+ new Partial(result.getFieldTypes(), result.getValues()); // defects4j.instrumentation
+ } catch (IllegalArgumentException e1) { // defects4j.instrumentation
+ throw new RuntimeException("[Defects4J_BugReport_Violation]"); // defects4j.instrumentation
+ } // defects4j.instrumentation
+ return result; // defects4j.instrumentation
+ } else { // defects4j.instrumentation
+ return with_original(fieldType, value); // defects4j.instrumentation
+ } // defects4j.instrumentation
+ } // defects4j.instrumentation
+
+ public Partial with_original(DateTimeFieldType fieldType, int value) { // defects4j.instrumentation
if (fieldType == null) {
throw new IllegalArgumentException("The field type must not be null");
}