Skip to content

Commit 9a791bb

Browse files
gselzerctrueden
authored andcommitted
Set initial max to 1
This allows a progress() check to return 0 instead of NaN
1 parent a9ed67a commit 9a791bb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • scijava/scijava-ops-engine/src/main/java/org/scijava/ops/engine/progress

scijava/scijava-ops-engine/src/main/java/org/scijava/ops/engine/progress/Task.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public Task(Task parent) {
2525

2626
boolean tasksDefined = false;
2727

28-
AtomicLong max = new AtomicLong(0);
28+
AtomicLong max = new AtomicLong(1);
2929

3030
AtomicLong current = new AtomicLong(0);
3131

@@ -47,6 +47,7 @@ private void recordSubtaskCompletion(Task task) {
4747
if (!subTasks.contains(task)) throw new IllegalArgumentException("Task " +
4848
task + " is not a subtask of Task " + this);
4949
subTasksCompleted.getAndIncrement();
50+
5051
}
5152

5253
public boolean isComplete() {

0 commit comments

Comments
 (0)