This is an automated email from the ASF dual-hosted git repository. mattsicker pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
commit 25d88be893b920f6ab1e3523d711dc61bd4f3bef Author: Matt Sicker <[email protected]> AuthorDate: Mon Jan 3 14:06:58 2022 -0600 Use try-with-resources Signed-off-by: Matt Sicker <[email protected]> --- .../apache/logging/log4j/plugins/spi/impl/InjectionTargetBean.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/log4j-plugins/src/main/java/org/apache/logging/log4j/plugins/spi/impl/InjectionTargetBean.java b/log4j-plugins/src/main/java/org/apache/logging/log4j/plugins/spi/impl/InjectionTargetBean.java index c64aa32..06ab925 100644 --- a/log4j-plugins/src/main/java/org/apache/logging/log4j/plugins/spi/impl/InjectionTargetBean.java +++ b/log4j-plugins/src/main/java/org/apache/logging/log4j/plugins/spi/impl/InjectionTargetBean.java @@ -59,12 +59,10 @@ class InjectionTargetBean<T> extends AbstractBean<T> { @Override public void destroy(final T instance, final InitializationContext<T> context) { - try { + try (context) { if (isDependentScoped()) { injectionTarget.preDestroy(instance); } - } finally { - context.close(); } }
