diff --git a/core/src/main/java/org/apache/gravitino/connector/BaseCatalog.java b/core/src/main/java/org/apache/gravitino/connector/BaseCatalog.java index 444e89062a6..a77fc1e5c2b 100644 --- a/core/src/main/java/org/apache/gravitino/connector/BaseCatalog.java +++ b/core/src/main/java/org/apache/gravitino/connector/BaseCatalog.java @@ -205,10 +205,8 @@ public void initAuthorizationPluginInstance(IsolatedClassLoader classLoader) { LOG.info("Authorization provider is not set!"); return; } - try { - BaseAuthorization authorization = - BaseAuthorization.createAuthorization(classLoader, authorizationProvider); - + try (BaseAuthorization authorization = + BaseAuthorization.createAuthorization(classLoader, authorizationProvider)) { // Load the authorization plugin with the class loader of the catalog. // Because the JDBC authorization plugin may load JDBC driver using the class loader. authorizationPlugin =