upload
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m8s

This commit is contained in:
Jan-Philipp Luithardt
2025-12-03 17:08:05 +01:00
parent efa4cbe744
commit 322763f98c
31 changed files with 79 additions and 37 deletions

View File

@@ -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());
}
}