fix selector dim filter check for value null

This commit is contained in:
fjy 2013-08-21 18:51:44 -07:00
parent ef12439df9
commit 0fa8b48fb7
1 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ public class SelectorDimFilter implements DimFilter
) )
{ {
Preconditions.checkArgument(dimension != null, "dimension must not be null"); Preconditions.checkArgument(dimension != null, "dimension must not be null");
Preconditions.checkArgument(value != null, "value must not be null");
this.dimension = dimension; this.dimension = dimension;
this.value = value; this.value = value;
} }
@ -48,7 +48,7 @@ public class SelectorDimFilter implements DimFilter
public byte[] getCacheKey() public byte[] getCacheKey()
{ {
byte[] dimensionBytes = dimension.getBytes(); byte[] dimensionBytes = dimension.getBytes();
byte[] valueBytes = value.getBytes(); byte[] valueBytes = (value == null) ? new byte[]{} : value.getBytes();
return ByteBuffer.allocate(1 + dimensionBytes.length + valueBytes.length) return ByteBuffer.allocate(1 + dimensionBytes.length + valueBytes.length)
.put(DimFilterCacheHelper.SELECTOR_CACHE_ID) .put(DimFilterCacheHelper.SELECTOR_CACHE_ID)