You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2020/10/16 08:48:22 UTC

[tomcat] branch master updated: SpotBugs - simplify logic

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 <ma...@apache.org>
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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org