[tomcat] branch master updated: SpotBugs - simplify logic

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[tomcat] branch master updated: SpotBugs - simplify logic

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

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
     new 1b27eec  SpotBugs - simplify logic
1b27eec is described below

commit 1b27eec74f80532ab539323450cb4f11a117f46d
Author: Mark Thomas <[hidden email]>
AuthorDate: Fri Oct 16 09:47:53 2020 +0100

    SpotBugs - simplify logic
---
 java/org/apache/catalina/valves/HealthCheckValve.java       | 2 +-
 java/org/apache/tomcat/util/digester/SetPropertiesRule.java | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/valves/HealthCheckValve.java b/java/org/apache/catalina/valves/HealthCheckValve.java
index 3dd9bec..0b7522e 100644
--- a/java/org/apache/catalina/valves/HealthCheckValve.java
+++ b/java/org/apache/catalina/valves/HealthCheckValve.java
@@ -96,7 +96,7 @@ public class HealthCheckValve extends ValveBase {
                 context ? request.getRequestPathMB() : request.getDecodedRequestURIMB();
         if (urlMB.equals(path)) {
             response.setContentType("application/json");
-            if (!checkContainersAvailable || (checkContainersAvailable && isAvailable(getContainer()))) {
+            if (!checkContainersAvailable || isAvailable(getContainer())) {
                 response.getOutputStream().print(UP);
             } else {
                 response.setStatus(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
diff --git a/java/org/apache/tomcat/util/digester/SetPropertiesRule.java b/java/org/apache/tomcat/util/digester/SetPropertiesRule.java
index 4779891..cec8263 100644
--- a/java/org/apache/tomcat/util/digester/SetPropertiesRule.java
+++ b/java/org/apache/tomcat/util/digester/SetPropertiesRule.java
@@ -95,8 +95,7 @@ public class SetPropertiesRule extends Rule {
                         "} Setting property '" + name + "' to '" +
                         value + "'");
             }
-            if (!digester.isFakeAttribute(top, name)
-                    && (excludes == null || (excludes != null && !excludes.containsKey(name)))) {
+            if (!digester.isFakeAttribute(top, name) && (excludes == null || !excludes.containsKey(name))) {
                 StringBuilder actualMethod = null;
                 if (code != null) {
                     actualMethod = new StringBuilder();


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]