mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-14 10:58:42 +00:00
docs: add explanation for Double-Checked Locking (#2914)
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
+2
-2
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user