mirror of https://github.com/apache/maven.git
[MNG-5729] Fix possible NPE with introduction of mononic clock (#1972)
This commit is contained in:
parent
a85ec9ffcc
commit
ccbd50c975
|
@ -23,6 +23,8 @@ import java.nio.file.Path;
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
|
import java.time.ZonedDateTime;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
@ -278,7 +280,8 @@ public class ExecutionEventLogger extends AbstractExecutionListener {
|
||||||
|
|
||||||
logger.info("Total time: {}{}", formatDuration(time), wallClock);
|
logger.info("Total time: {}{}", formatDuration(time), wallClock);
|
||||||
|
|
||||||
logger.info("Finished at: {}", formatTimestamp(finish.atZone(ZoneId.systemDefault())));
|
ZonedDateTime rounded = finish.truncatedTo(ChronoUnit.SECONDS).atZone(ZoneId.systemDefault());
|
||||||
|
logger.info("Finished at: {}", formatTimestamp(rounded));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -927,7 +927,7 @@ public class BuildPlanExecutor {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Duration wallTime() {
|
protected Duration wallTime() {
|
||||||
return Duration.between(start, end);
|
return start != null && end != null ? Duration.between(start, end) : Duration.ZERO;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Duration execTime() {
|
protected Duration execTime() {
|
||||||
|
|
Loading…
Reference in New Issue