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"
|
||||
|
||||
group = "com.jdbernard"
|
||||
version = "3.7"
|
||||
version = "3.8"
|
||||
|
||||
repositories {
|
||||
mavenCentral() }
|
||||
|
@ -18,6 +18,9 @@ class ConsoleProgressBar {
|
||||
private String lastInfo = ""
|
||||
private long startTime
|
||||
|
||||
public void setMax(int max) {
|
||||
this.max = Math.max(max, 1) }
|
||||
|
||||
void update(int value, String info) {
|
||||
if (value == 0 || startTime == 0)
|
||||
startTime = System.currentTimeMillis()
|
||||
|
Loading…
Reference in New Issue
Block a user