rdfhdt / hdt-java

HDT Java library and tools.
Other
94 stars 69 forks source link

fix IndexOutOfBound for loaded HDT BigByteBuffer of size > 2^31 #161

Closed ate47 closed 2 years ago

ate47 commented 2 years ago

In the pull request #104, I forgot to cast to long a value, it was throwing an exception for big enough hdt, example:

java.lang.ArrayIndexOutOfBoundsException: Index 74 out of bounds for length 74
        at org.rdfhdt.hdt.util.string.ByteStringUtil.strcmp(ByteStringUtil.java:193) ~[hdt-java-core-3.0.2.jar!/:na]
        at org.rdfhdt.hdt.dictionary.impl.section.PFCDictionarySectionBig.locateBlock(PFCDictionarySectionBig.java:242) ~[hdt-java-core-3.0.2.jar!/:na]
        at org.rdfhdt.hdt.dictionary.impl.section.PFCDictionarySectionBig.locate(PFCDictionarySectionBig.java:263) ~[hdt-java-core-3.0.2.jar!/:na]
        at org.rdfhdt.hdt.dictionary.impl.BaseDictionary.stringToId(BaseDictionary.java:136) ~[hdt-java-core-3.0.2.jar!/:na]

This pull request contains the fix for this error.

D063520 commented 2 years ago

top!