Skip to content

Commit

Permalink
bug fixed for null object hash value and string storage in object int…
Browse files Browse the repository at this point in the history
…ern pool
  • Loading branch information
workeatsleep committed Oct 17, 2023
1 parent f72303e commit 2ba623f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ public static int fieldHashCode(HollowObjectTypeDataAccess typeAccess, int ordin
}

public static int hashObject(Object value) {
if (value == null) {
return 0;
}
if(value instanceof Integer) {
return HollowReadFieldUtils.intHashCode((Integer)value);
} else if(value instanceof String) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public long getLong(long pointer) {

public String getString(long pointer) {
ByteData byteData = ordinalMap.getByteData().getUnderlyingArray();
int length = byteData.get(pointer);
int length = VarInt.readVInt(byteData, pointer);
byte[] bytes = new byte[length];
for(int i=0;i<length;i++) {
bytes[i] = byteData.get(pointer+1+i);
Expand Down

0 comments on commit 2ba623f

Please sign in to comment.