protect against a case when string field data value is null
This commit is contained in:
parent
89d31bbfde
commit
f2bd2c7bbd
|
@ -43,7 +43,9 @@ public abstract class StringFieldData extends FieldData<StringDocFieldData> {
|
||||||
@Override protected long computeSizeInBytes() {
|
@Override protected long computeSizeInBytes() {
|
||||||
long size = RamUsage.NUM_BYTES_ARRAY_HEADER;
|
long size = RamUsage.NUM_BYTES_ARRAY_HEADER;
|
||||||
for (String value : values) {
|
for (String value : values) {
|
||||||
size += RamUsage.NUM_BYTES_OBJECT_HEADER + value.length() * RamUsage.NUM_BYTES_CHAR + (3 * RamUsage.NUM_BYTES_INT);
|
if (value != null) {
|
||||||
|
size += RamUsage.NUM_BYTES_OBJECT_HEADER + ((value.length() * RamUsage.NUM_BYTES_CHAR) + (3 * RamUsage.NUM_BYTES_INT));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue