Author: bayard
Date: Sun Mar 1 21:02:57 2009
New Revision: 749101
URL: http://svn.apache.org/viewvc?rev=749101&view=rev
Log:
Removing the notion that -1 was a special state value. The code was changed a
while back to have properly defined states. Helps prepare for LANG-478
Modified:
commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/StopWatch.java
Modified:
commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/StopWatch.java
URL:
http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/StopWatch.java?rev=749101&r1=749100&r2=749101&view=diff
==============================================================================
---
commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/StopWatch.java
(original)
+++
commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/StopWatch.java
Sun Mar 1 21:02:57 2009
@@ -83,12 +83,12 @@
/**
* The start time.
*/
- private long startTime = -1;
+ private long startTime;
/**
* The stop time.
*/
- private long stopTime = -1;
+ private long stopTime;
/**
* <p>
@@ -118,7 +118,6 @@
if (this.runningState != STATE_UNSTARTED) {
throw new IllegalStateException("Stopwatch already started. ");
}
- this.stopTime = -1;
this.startTime = System.currentTimeMillis();
this.runningState = STATE_RUNNING;
}
@@ -157,8 +156,6 @@
public void reset() {
this.runningState = STATE_UNSTARTED;
this.splitState = STATE_UNSPLIT;
- this.startTime = -1;
- this.stopTime = -1;
}
/**
@@ -199,7 +196,6 @@
if (this.splitState != STATE_SPLIT) {
throw new IllegalStateException("Stopwatch has not been split. ");
}
- this.stopTime = -1;
this.splitState = STATE_UNSPLIT;
}
@@ -242,7 +238,6 @@
throw new IllegalStateException("Stopwatch must be suspended to
resume. ");
}
this.startTime += (System.currentTimeMillis() - this.stopTime);
- this.stopTime = -1;
this.runningState = STATE_RUNNING;
}