From fa55cc2cee081a81d54bbeb223c47be8f4009404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20L=C3=B3pez=20Nozal?= Date: Thu, 26 Feb 2026 18:42:43 +0100 Subject: [PATCH] Make ReusablePool implement AutoCloseable Implement AutoCloseable interface and add close method. --- src/main/java/ubu/gii/dass/c01/ReusablePool.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/ubu/gii/dass/c01/ReusablePool.java b/src/main/java/ubu/gii/dass/c01/ReusablePool.java index ee5175ce..97371c16 100644 --- a/src/main/java/ubu/gii/dass/c01/ReusablePool.java +++ b/src/main/java/ubu/gii/dass/c01/ReusablePool.java @@ -7,7 +7,7 @@ * @author Carlos López clopezno@ubu.es */ -public final class ReusablePool{ +public final class ReusablePool implements AutoCloseable{ private Vector reusables; private static ReusablePool instance; @@ -59,5 +59,11 @@ public void releaseReusable(Reusable r) throws DuplicatedInstanceException { else{ throw(new DuplicatedInstanceException()); } + } + + @Override + public void close() { + instance = null; } -} \ No newline at end of file + +}