ConsoleProgressBar: Prevent max from being non-positive.
This commit is contained in:
parent
14903c866c
commit
1d3f8d71e2
@ -2,7 +2,7 @@ apply plugin: "groovy"
|
|||||||
apply plugin: "maven"
|
apply plugin: "maven"
|
||||||
|
|
||||||
group = "com.jdbernard"
|
group = "com.jdbernard"
|
||||||
version = "3.7"
|
version = "3.8"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral() }
|
mavenCentral() }
|
||||||
|
@ -18,6 +18,9 @@ class ConsoleProgressBar {
|
|||||||
private String lastInfo = ""
|
private String lastInfo = ""
|
||||||
private long startTime
|
private long startTime
|
||||||
|
|
||||||
|
public void setMax(int max) {
|
||||||
|
this.max = Math.max(max, 1) }
|
||||||
|
|
||||||
void update(int value, String info) {
|
void update(int value, String info) {
|
||||||
if (value == 0 || startTime == 0)
|
if (value == 0 || startTime == 0)
|
||||||
startTime = System.currentTimeMillis()
|
startTime = System.currentTimeMillis()
|
||||||
|
Loading…
Reference in New Issue
Block a user