You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Maryann Xue (JIRA)" <ji...@apache.org> on 2014/08/29 19:11:53 UTC
[jira] [Created] (PHOENIX-1220) NullPointerException in
PArrayDataType.toObject() when baseType is CHAR or BINARY
Maryann Xue created PHOENIX-1220:
------------------------------------
Summary: NullPointerException in PArrayDataType.toObject() when baseType is CHAR or BINARY
Key: PHOENIX-1220
URL: https://issues.apache.org/jira/browse/PHOENIX-1220
Project: Phoenix
Issue Type: Bug
Affects Versions: 5.0.0
Reporter: Maryann Xue
Priority: Minor
We now assume that for PDataType, if isFixedLength() returns true, we can use getByteSize() to get the byte array length of this type. But with BINARY and CHAR types, isFixedLength() returns true while getByteSize() returns null, and that's why we would get an NPE if we write code like:
{code:title=PArrayDataType.createPhoenixArray()}
if (!baseDataType.isFixedWidth()) {
...
} else {
int elemLength = (maxLength == null ? baseDataType.getByteSize() : maxLength);
...
}
{code}
There are more than one occurrences of such code besides this one.
--
This message was sent by Atlassian JIRA
(v6.2#6252)