upload
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m8s
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m8s
This commit is contained in:
@@ -47,12 +47,12 @@ public class TaskManager {
|
||||
|
||||
throw new IllegalArgumentException("Name is null!");
|
||||
}
|
||||
if(name.isEmpty() || this.taskMap.values().stream().anyMatch(t -> t.getName().equals(name))) {
|
||||
if(name.isEmpty() || this.taskMap.values().stream().noneMatch(t -> t.getName().equals(name))) {
|
||||
throw new IllegalArgumentException("Wrong name!");
|
||||
}
|
||||
|
||||
this.taskMap.remove(this.taskMap.values().stream().filter(t -> t.getName().equals(name)).findFirst()
|
||||
.orElseThrow(() -> new IllegalArgumentException("Cant find a Task")).getTaskID());
|
||||
.orElseThrow().getTaskID());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user