Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes an ArrayIndexOutOfBounds issue iterating over relationships #1011

Merged
merged 1 commit into from Aug 8, 2013

Commits on Aug 6, 2013

  1. Fixes an ArrayIndexOutOfBounds issue iterating over relationships

    Issue manifests in calling #next() on the iterator gotten from
    Node#getRelationships(...) would suddenly throw ArrayIndexOutOfBoundsException.
    
    Cause of the issue was this: Internally a RelationshipIterator would have
    all internal per-type relationship iterators in an array. Exhausting one
    would try to move to the next, if any. The check that tested if there were
    more per-type iterators to visit incremented the array index and if that
    check would yield false an additional check to load more relationships
    would be made, and if that also yielded false the current per-type iterator
    would be tested again. In this case another transaction would have created
    another relationship so that relationship would be returned.
      The consecutive call to #next() would start off getting the current
    per-type iterator and this is where the array index would point to an
    index that was one too high than allowed.
    
    Fix is to not increment the index in the check, but instead increment if
    the check yields true.
    tinwelint committed Aug 6, 2013
    Configuration menu
    Copy the full SHA
    f834d96 View commit details
    Browse the repository at this point in the history