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

@@ -41,5 +41,19 @@ public class TaskManager {
}
<span class="fc" id="L42"> return this.taskMap.get(taskID);</span>
}
public void deleteTask(String name) {
<span class="fc bfc" id="L46" title="All 2 branches covered."> if (name == null ) {</span>
<span class="fc" id="L48"> throw new IllegalArgumentException(&quot;Name is null!&quot;);</span>
}
<span class="fc bfc" id="L50" title="All 4 branches covered."> if(name.isEmpty() || this.taskMap.values().stream().noneMatch(t -&gt; t.getName().equals(name))) {</span>
<span class="fc" id="L51"> throw new IllegalArgumentException(&quot;Wrong name!&quot;);</span>
}
<span class="fc" id="L54"> this.taskMap.remove(this.taskMap.values().stream().filter(t -&gt; t.getName().equals(name)).findFirst()</span>
<span class="fc" id="L55"> .orElseThrow().getTaskID());</span>
<span class="fc" id="L57"> }</span>
}
</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.13.202504020838</span></div></body></html>