-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlang_55.diff
27 lines (27 loc) · 1.55 KB
/
lang_55.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
diff --git a/src/java/org/apache/commons/lang/time/StopWatch.java b/src/java/org/apache/commons/lang/time/StopWatch.java
index 8f394217..6fcae6ed 100644
--- a/src/java/org/apache/commons/lang/time/StopWatch.java
+++ b/src/java/org/apache/commons/lang/time/StopWatch.java
@@ -112,6 +112,22 @@ public class StopWatch {
* @throws IllegalStateException if the StopWatch is not running.
*/
public void stop() {
+ if (Boolean.parseBoolean(System.getProperty("defects4j.instrumentation.enabled"))) { // defects4j.instrumentation
+ if (this.runningState == STATE_SUSPENDED) { // defects4j.instrumentation
+ long stopTimeTmp = stopTime; // defects4j.instrumentation
+ stop_original(); // defects4j.instrumentation
+ if (stopTime != stopTimeTmp) { // defects4j.instrumentation
+ throw new RuntimeException("[Defects4J_BugReport_Violation]"); // defects4j.instrumentation
+ } // defects4j.instrumentation
+ } else { // defects4j.instrumentation
+ stop_original(); // defects4j.instrumentation
+ } // defects4j.instrumentation
+ } else { // defects4j.instrumentation
+ stop_original(); // defects4j.instrumentation
+ } // defects4j.instrumentation
+ } // defects4j.instrumentation
+
+ public void stop_original() { // defects4j.instrumentation
if(this.runningState != STATE_RUNNING && this.runningState != STATE_SUSPENDED) {
throw new IllegalStateException("Stopwatch is not running. ");
}