From 8864189257d1f93ac867425082e8280d97c54162 Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Mon, 21 Jan 2013 01:32:09 +0000 Subject: [PATCH] Value cannot be null (Eclipse) git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1436070 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/commons/collections/trie/AbstractKeyAnalyzer.java | 2 +- .../java/org/apache/commons/collections/trie/AbstractTrie.java | 2 +- .../apache/commons/collections/trie/ByteArrayKeyAnalyzer.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/apache/commons/collections/trie/AbstractKeyAnalyzer.java b/src/main/java/org/apache/commons/collections/trie/AbstractKeyAnalyzer.java index b7f24719b..37f369204 100644 --- a/src/main/java/org/apache/commons/collections/trie/AbstractKeyAnalyzer.java +++ b/src/main/java/org/apache/commons/collections/trie/AbstractKeyAnalyzer.java @@ -34,7 +34,7 @@ public abstract class AbstractKeyAnalyzer implements KeyAnalyzer { if (o1 == null) { return o2 == null ? 0 : -1; } else if (o2 == null) { - return o1 == null ? 0 : 1; + return 1; } return ((Comparable)o1).compareTo(o2); diff --git a/src/main/java/org/apache/commons/collections/trie/AbstractTrie.java b/src/main/java/org/apache/commons/collections/trie/AbstractTrie.java index 146810553..451bc9b21 100644 --- a/src/main/java/org/apache/commons/collections/trie/AbstractTrie.java +++ b/src/main/java/org/apache/commons/collections/trie/AbstractTrie.java @@ -150,7 +150,7 @@ abstract class AbstractTrie extends AbstractMap if (key == null) { return other == null; } else if (other == null) { - return key == null; + return false; } return keyAnalyzer.compare(key, other) == 0; diff --git a/src/main/java/org/apache/commons/collections/trie/ByteArrayKeyAnalyzer.java b/src/main/java/org/apache/commons/collections/trie/ByteArrayKeyAnalyzer.java index 58e3a368c..f9227fa7c 100644 --- a/src/main/java/org/apache/commons/collections/trie/ByteArrayKeyAnalyzer.java +++ b/src/main/java/org/apache/commons/collections/trie/ByteArrayKeyAnalyzer.java @@ -181,7 +181,7 @@ public class ByteArrayKeyAnalyzer extends AbstractKeyAnalyzer { if (o1 == null) { return o2 == null ? 0 : -1; } else if (o2 == null) { - return o1 == null ? 0 : 1; + return 1; } if (o1.length != o2.length) {