Repository: hive Updated Branches: refs/heads/master bc0138c43 -> 2d87c12d9
HIVE-10590 fix potential NPE in HiveMetaStore.equals (Alexander Pivovarov, reviewed by Ashutosh Chauhan) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/2d87c12d Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/2d87c12d Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/2d87c12d Branch: refs/heads/master Commit: 2d87c12d914044540a4f5ed7fe500e3c245fbead Parents: bc0138c Author: Alexander Pivovarov <apivova...@gmail.com> Authored: Sun May 3 18:22:12 2015 -0700 Committer: Alexander Pivovarov <apivova...@gmail.com> Committed: Thu May 14 14:42:12 2015 -0700 ---------------------------------------------------------------------- .../org/apache/hadoop/hive/metastore/HiveMetaStore.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/2d87c12d/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java ---------------------------------------------------------------------- diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java index 986579a..e796048 100644 --- a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java @@ -2024,8 +2024,14 @@ public class HiveMetaStore extends ThriftHiveMetastore { if (!p1.isSetValues() || !p2.isSetValues()) return p1.isSetValues() == p2.isSetValues(); if (p1.getValues().size() != p2.getValues().size()) return false; for (int i = 0; i < p1.getValues().size(); ++i) { - String v1 = p1.getValues().get(i), v2 = p2.getValues().get(i); - if ((v1 == null && v2 != null) || !v1.equals(v2)) return false; + String v1 = p1.getValues().get(i); + String v2 = p2.getValues().get(i); + if (v1 == null && v2 == null) { + continue; + } + if (v1 == null || !v1.equals(v2)) { + return false; + } } return true; }