Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Commit bebc59d

Browse files
author
Ivan Suftin
committed
Fixes stopwatch already started error
1 parent 7c0ef89 commit bebc59d

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

gdp-process-wps/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,11 @@
208208
<groupId>gov.usgs.cida.jmx</groupId>
209209
<artifactId>jmx-log4j</artifactId>
210210
</dependency>
211+
<dependency>
212+
<groupId>org.apache.commons</groupId>
213+
<artifactId>commons-lang3</artifactId>
214+
<version>3.9</version>
215+
</dependency>
211216
<dependency>
212217
<groupId>commons-lang</groupId>
213218
<artifactId>commons-lang</artifactId>

gdp-process-wps/src/main/java/gov/usgs/cida/gdp/wps/algorithm/heuristic/TotalTimeAlgorithmHeuristic.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import gov.usgs.cida.gdp.constants.AppConstant;
44
import gov.usgs.cida.gdp.wps.algorithm.heuristic.exception.AlgorithmHeuristicException;
5-
import org.apache.commons.lang.time.StopWatch;
5+
import org.apache.commons.lang3.time.StopWatch;
66
import org.joda.time.MutablePeriod;
77
import org.joda.time.ReadablePeriod;
88
import org.slf4j.Logger;
@@ -61,8 +61,11 @@ public void tEnd(int tIndex) {
6161

6262
@Override
6363
public boolean tStart(int tIndex) {
64-
if (stopwatch.getTime() == 0) {
65-
stopwatch.start();
64+
if (! stopwatch.isStarted()) {
65+
if (stopwatch.isStopped()) {
66+
stopwatch.reset();
67+
}
68+
stopwatch.start();
6669
}
6770
return traverseContinue();
6871
}

pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,12 @@
357357
<version>${netcdf.version}</version>
358358
<type>pom</type>
359359
<scope>import</scope>
360+
<exclusions>
361+
<exclusion>
362+
<groupId>org.apache.commons</groupId>
363+
<artifactId>commons-lang3</artifactId>
364+
</exclusion>
365+
</exclusions>
360366
</dependency>
361367
<dependency>
362368
<groupId>edu.ucar</groupId>

0 commit comments

Comments
 (0)