This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push:
new 09bdf9cc5d Remove useless null checks
09bdf9cc5d is described below
commit 09bdf9cc5d95c2c40f82f41f8bdbdb40fa562f4c
Author: remm <[email protected]>
AuthorDate: Fri Sep 15 16:27:11 2023 +0200
Remove useless null checks
Found by coverity.
---
java/org/apache/tomcat/util/digester/CallMethodRule.java | 2 +-
java/org/apache/tomcat/util/digester/SetPropertiesRule.java | 11 +++--------
2 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/java/org/apache/tomcat/util/digester/CallMethodRule.java
b/java/org/apache/tomcat/util/digester/CallMethodRule.java
index 60e7382ee0..7d78c997b5 100644
--- a/java/org/apache/tomcat/util/digester/CallMethodRule.java
+++ b/java/org/apache/tomcat/util/digester/CallMethodRule.java
@@ -332,7 +332,7 @@ public class CallMethodRule extends Rule {
return;
}
- } else if (paramTypes != null && paramTypes.length != 0) {
+ } else if (paramTypes.length != 0) {
// In the case where the parameter for the method
// is taken from the body text, but there is no
diff --git a/java/org/apache/tomcat/util/digester/SetPropertiesRule.java
b/java/org/apache/tomcat/util/digester/SetPropertiesRule.java
index f24b38e8a6..1b8b7b1658 100644
--- a/java/org/apache/tomcat/util/digester/SetPropertiesRule.java
+++ b/java/org/apache/tomcat/util/digester/SetPropertiesRule.java
@@ -45,14 +45,9 @@ public class SetPropertiesRule extends Rule {
// Populate the corresponding properties of the top object
Object top = digester.peek();
if (digester.log.isDebugEnabled()) {
- if (top != null) {
- digester.log.debug("[SetPropertiesRule]{" + digester.match +
- "} Set " + top.getClass().getName() +
- " properties");
- } else {
- digester.log.debug("[SetPropertiesRule]{" + digester.match +
- "} Set NULL properties");
- }
+ digester.log.debug("[SetPropertiesRule]{" + digester.match +
+ "} Set " + top.getClass().getName() +
+ " properties");
}
for (int i = 0; i < attributes.getLength(); i++) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]