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/11/26 13:35:42 UTC

[commons-collections] branch master updated: Make the code clearer (#119)

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 f086233  Make the code clearer (#119)
f086233 is described below

commit f08623354efe4d801e4c1e29c0eb970b166b2c8c
Author: Chen <50...@users.noreply.github.com>
AuthorDate: Tue Nov 26 21:35:33 2019 +0800

    Make the code clearer (#119)
---
 src/main/java/org/apache/commons/collections4/list/TreeList.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/commons/collections4/list/TreeList.java b/src/main/java/org/apache/commons/collections4/list/TreeList.java
index 7e04b44..fc24215 100644
--- a/src/main/java/org/apache/commons/collections4/list/TreeList.java
+++ b/src/main/java/org/apache/commons/collections4/list/TreeList.java
@@ -24,6 +24,7 @@ import java.util.Deque;
 import java.util.Iterator;
 import java.util.ListIterator;
 import java.util.NoSuchElementException;
+import java.util.Objects;
 
 import org.apache.commons.collections4.OrderedIterator;
 
@@ -438,7 +439,7 @@ public class TreeList<E> extends AbstractList<E> {
                     return result;
                 }
             }
-            if (value == null ? value == object : value.equals(object)) {
+            if (Objects.equals(value, object)) {
                 return index;
             }
             if (getRightSubTree() != null) {