Repository: phoenix Updated Branches: refs/heads/master ea22dd5e0 -> 5c25a728e
PHOENIX-2620 NPE in org.apache.phoenix.expression.util.regex.JavaPattern.matches(Nicolas Liochon) Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/5c25a728 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/5c25a728 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/5c25a728 Branch: refs/heads/master Commit: 5c25a728e165cae8672522cb11ab2acbdbd72851 Parents: ea22dd5 Author: Samarth <samarth.j...@salesforce.com> Authored: Wed Feb 3 13:15:19 2016 -0800 Committer: Samarth <samarth.j...@salesforce.com> Committed: Wed Feb 3 13:15:19 2016 -0800 ---------------------------------------------------------------------- .../java/org/apache/phoenix/expression/util/regex/JavaPattern.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/5c25a728/phoenix-core/src/main/java/org/apache/phoenix/expression/util/regex/JavaPattern.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/expression/util/regex/JavaPattern.java b/phoenix-core/src/main/java/org/apache/phoenix/expression/util/regex/JavaPattern.java index 707bced..ccdb5af 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/expression/util/regex/JavaPattern.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/expression/util/regex/JavaPattern.java @@ -47,7 +47,7 @@ public class JavaPattern extends AbstractBasePattern { public void matches(ImmutableBytesWritable srcPtr) { Preconditions.checkNotNull(srcPtr); String matcherSourceStr = (String) PVarchar.INSTANCE.toObject(srcPtr); - if (srcPtr.get().length == 0 && matcherSourceStr == null) matcherSourceStr = ""; + if (srcPtr.getLength() == 0 && matcherSourceStr == null) matcherSourceStr = ""; boolean ret = pattern.matcher(matcherSourceStr).matches(); srcPtr.set(ret ? PDataType.TRUE_BYTES : PDataType.FALSE_BYTES); }