diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/PropertiesLoader.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/PropertiesLoader.java index 8f3d7aa028..90de1d13a2 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/PropertiesLoader.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/PropertiesLoader.java @@ -26,7 +26,7 @@ public class PropertiesLoader { private static final Logger logger = Logger.getLogger(PropertiesLoader.class); - static Map staticCache = new HashMap<>(); + static final Map staticCache = new HashMap<>(); protected boolean debug; public void init(Map options) { diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/container/InVMInitialContextFactory.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/container/InVMInitialContextFactory.java index 5952d36bef..36bd5fad23 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/container/InVMInitialContextFactory.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/container/InVMInitialContextFactory.java @@ -31,11 +31,7 @@ public class InVMInitialContextFactory implements InitialContextFactory { // Static -------------------------------------------------------- - private static Map initialContexts; - - static { - InVMInitialContextFactory.reset(); - } + private static final Map initialContexts = new HashMap<>(); public static Hashtable getJNDIEnvironment() { return InVMInitialContextFactory.getJNDIEnvironment(0); @@ -104,10 +100,6 @@ public class InVMInitialContextFactory implements InitialContextFactory { } } - public static void reset() { - InVMInitialContextFactory.initialContexts = new HashMap<>(); - } - // Package protected --------------------------------------------- // Protected -----------------------------------------------------