This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git


The following commit(s) were added to refs/heads/release-2.x by this push:
     new 58ee2ea  Null check already performed in closeSilently(), also return 
the result of the close call.
58ee2ea is described below

commit 58ee2ea05c5a8f6e488e0bbd3c4817c274ebd6ef
Author: Gary Gregory <[email protected]>
AuthorDate: Mon Dec 13 06:31:59 2021 -0500

    Null check already performed in closeSilently(), also return the result
    of the close call.
---
 .../src/main/java/org/apache/logging/log4j/core/net/JndiManager.java | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git 
a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/JndiManager.java 
b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/JndiManager.java
index cbb6b12..4ed838d 100644
--- 
a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/JndiManager.java
+++ 
b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/JndiManager.java
@@ -206,10 +206,7 @@ public class JndiManager extends AbstractManager {
 
     @Override
     protected boolean releaseSub(final long timeout, final TimeUnit timeUnit) {
-        if (context != null) {
-            return JndiCloser.closeSilently(this.context);
-        }
-        return true;
+        return JndiCloser.closeSilently(this.context);
     }
 
     /**

Reply via email to