diff --git a/here-naksha-lib-ext-manager/src/main/java/com/here/naksha/lib/extmanager/ExtensionCache.java b/here-naksha-lib-ext-manager/src/main/java/com/here/naksha/lib/extmanager/ExtensionCache.java index fa235f106..e38b9729b 100644 --- a/here-naksha-lib-ext-manager/src/main/java/com/here/naksha/lib/extmanager/ExtensionCache.java +++ b/here-naksha-lib-ext-manager/src/main/java/com/here/naksha/lib/extmanager/ExtensionCache.java @@ -112,9 +112,8 @@ private void publishIntoCache(KVPair result, ExtensionConfig ex if (!isNullOrEmpty(extension.getInitClassName())) { try { Class clz = loader.loadClass(extension.getInitClassName()); - Object obj = clz.getConstructor(INaksha.class, Extension.class).newInstance(naksha, extension); + Object obj = clz.getConstructor().newInstance(); if (obj instanceof IExtensionInit initInstance) { - initInstance.close(); initInstance.init(naksha, extension); instance = initInstance; } else { @@ -152,15 +151,12 @@ private void removeExtensionFromCache(String extensionId) { ValueTuple valueTuple = loaderCache.get(extensionId); if (valueTuple != null) { IExtensionInit instance = valueTuple.getInstance(); - Extension extension = valueTuple.getExtension(); - final String extensionIdWithEnv = extension.getEnv() + ":" + extension.getId(); - if (instance != null) { try { instance.close(); - logger.info("Extension {} closed successfully.", extensionIdWithEnv); + logger.info("Extension {} closed successfully.", extensionId); } catch (Exception e) { - logger.error("Failed to close extension {}", extensionIdWithEnv, e); + logger.error("Failed to close extension {}", extensionId, e); } }