You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2020/11/20 22:24:41 UTC

[commons-chain] branch master updated: Remove useless null-check.

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

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-chain.git


The following commit(s) were added to refs/heads/master by this push:
     new cc12c69  Remove useless null-check.
cc12c69 is described below

commit cc12c69db7bc3ebd034128f643c6a6f514aa02b6
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Nov 20 17:24:37 2020 -0500

    Remove useless null-check.
---
 web/src/main/java/org/apache/commons/chain2/web/MapEntry.java           | 2 +-
 .../java/org/apache/commons/chain2/web/servlet/ServletPathMapper.java   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/web/src/main/java/org/apache/commons/chain2/web/MapEntry.java b/web/src/main/java/org/apache/commons/chain2/web/MapEntry.java
index 40e01da..f881b63 100644
--- a/web/src/main/java/org/apache/commons/chain2/web/MapEntry.java
+++ b/web/src/main/java/org/apache/commons/chain2/web/MapEntry.java
@@ -100,7 +100,7 @@ public class MapEntry<K, V> implements Map.Entry<K, V> {
      */
     @Override
     public boolean equals(Object o) {
-        if (o != null && o instanceof Map.Entry) {
+        if (o instanceof Map.Entry) {
             Map.Entry<?, ?> entry = (Map.Entry<?, ?>) o;
             return (this.getKey() == null ?
                     entry.getKey() == null : this.getKey().equals(entry.getKey()))  &&
diff --git a/web/src/main/java/org/apache/commons/chain2/web/servlet/ServletPathMapper.java b/web/src/main/java/org/apache/commons/chain2/web/servlet/ServletPathMapper.java
index cd5679d..8600f52 100644
--- a/web/src/main/java/org/apache/commons/chain2/web/servlet/ServletPathMapper.java
+++ b/web/src/main/java/org/apache/commons/chain2/web/servlet/ServletPathMapper.java
@@ -84,7 +84,7 @@ public class ServletPathMapper extends LookupCommand<String, Object, ServletWebC
          */
         @SuppressWarnings("unchecked")
         Catalog<String, Object, ServletWebContext<String, Object>> catalog =
-                testCatalog != null && testCatalog instanceof Catalog ?
+                testCatalog instanceof Catalog ?
                     (Catalog<String, Object, ServletWebContext<String, Object>>) testCatalog :
                     super.getCatalog(context);