Repository: phoenix Updated Branches: refs/heads/4.x-HBase-0.98 ad462863d -> 91667bb08
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/91667bb0 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/91667bb0 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/91667bb0 Branch: refs/heads/4.x-HBase-0.98 Commit: 91667bb0812bd36b9e8fcab239940b8bf96dadf7 Parents: ad46286 Author: Samarth <[email protected]> Authored: Wed Feb 3 13:13:37 2016 -0800 Committer: Samarth <[email protected]> Committed: Wed Feb 3 13:13:37 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/91667bb0/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); }
