docs: add explanation for Double-Checked Locking (#2914)

This commit is contained in:
Ilkka Seppälä
2024-04-13 08:02:29 +03:00
committed by GitHub
parent 2807f1f976
commit 9240d80ef2
3 changed files with 115 additions and 14 deletions
@@ -35,7 +35,6 @@ class AppTest {
/**
* Issue: Add at least one assertion to this test case.
*
* Solution: Inserted assertion to check whether the execution of the main method in {@link App#main(String[])}
* throws an exception.
*/
@@ -80,7 +80,7 @@ class InventoryTest {
* item limit.
*/
@Test
void testAddItem() throws Exception {
void testAddItem() {
assertTimeout(ofMillis(10000), () -> {
// Create a new inventory with a limit of 1000 items and put some load on the add method
final var inventory = new Inventory(INVENTORY_SIZE);
@@ -109,7 +109,7 @@ class InventoryTest {
}
private class InMemoryAppender extends AppenderBase<ILoggingEvent> {
private static class InMemoryAppender extends AppenderBase<ILoggingEvent> {
private final List<ILoggingEvent> log = new LinkedList<>();
public InMemoryAppender(Class clazz) {