From 09bac685fa07fc466bd8d463d69f4abbc0680696 Mon Sep 17 00:00:00 2001 From: Santiago Lo Coco Date: Tue, 27 Feb 2024 14:33:36 +0100 Subject: [PATCH] Enforce Library singleton --- src/main/java/edu/uastw/Library.java | 2 +- src/main/java/edu/uastw/LibraryDecorator.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/edu/uastw/Library.java b/src/main/java/edu/uastw/Library.java index 35743ce..8d1da39 100644 --- a/src/main/java/edu/uastw/Library.java +++ b/src/main/java/edu/uastw/Library.java @@ -9,7 +9,7 @@ public class Library implements Iterable { private final List libraryItems; private int booksCapacity = 3; - Library() { + private Library() { this.libraryItems = new ArrayList<>(); } diff --git a/src/main/java/edu/uastw/LibraryDecorator.java b/src/main/java/edu/uastw/LibraryDecorator.java index 2e6eb2c..affd9f5 100644 --- a/src/main/java/edu/uastw/LibraryDecorator.java +++ b/src/main/java/edu/uastw/LibraryDecorator.java @@ -1,6 +1,6 @@ package edu.uastw; -public abstract class LibraryDecorator extends Library { +public abstract class LibraryDecorator { protected Library library; public LibraryDecorator(Library library) {