Skip to content
This repository was archived by the owner on May 10, 2023. It is now read-only.
This repository was archived by the owner on May 10, 2023. It is now read-only.

Terrible bug in DoubleArrayTrie#resolveConflict() #3

@ghost

Description

I am using your DoubleArrayTrie project for some indexing project of mine, and I discovered a terrible bug: method resolveConflict(), line

if ( tempNext < getSize() && getCheck(tempNext) == s)

should read:

if ( tempNext >= 0 && tempNext < getSize() && getCheck(tempNext) == s)

as tempNext , which is equal to getBase(s) + c, may be equal to -2, which throws an ArrayIndexOutofBoundsException, or an AssertionError if you are so lucky as to be running with -ea. I.e., in case of resolving a conflict for a leaf node, you'll always run through this faulty implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions