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 2019/02/09 19:36:36 UTC

[commons-collections] branch master updated: [FixedOrderComparator] Simplify always false condition

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-collections.git


The following commit(s) were added to refs/heads/master by this push:
     new 896334a  [FixedOrderComparator] Simplify always false condition
     new a5347eb  Merge pull request #67 from grimreaper/eax/no-dead-map-impl
896334a is described below

commit 896334a1e3f2627040a0240debc0ebd4593df916
Author: Eitan Adler <li...@eitanadler.com>
AuthorDate: Fri Feb 8 23:57:10 2019 -0800

    [FixedOrderComparator] Simplify always false condition
    
    map is a final value initialized to an object and can never be null.
---
 .../apache/commons/collections4/comparators/FixedOrderComparator.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/commons/collections4/comparators/FixedOrderComparator.java b/src/main/java/org/apache/commons/collections4/comparators/FixedOrderComparator.java
index f31d519..99fab3a 100644
--- a/src/main/java/org/apache/commons/collections4/comparators/FixedOrderComparator.java
+++ b/src/main/java/org/apache/commons/collections4/comparators/FixedOrderComparator.java
@@ -257,7 +257,7 @@ public class FixedOrderComparator<T> implements Comparator<T>, Serializable {
     @Override
     public int hashCode() {
         int total = 17;
-        total = total*37 + (map == null ? 0 : map.hashCode());
+        total = total*37 + map.hashCode();
         total = total*37 + (unknownObjectBehavior == null ? 0 : unknownObjectBehavior.hashCode());
         total = total*37 + counter;
         total = total*37 + (isLocked ? 0 : 1);