Skip to content

[4.0.1] ArrayIndexOutOfBoundsException #623

@hrstoyanov

Description

@hrstoyanov

Environment Details

  • EclipseStore Version: 4.0.1
  • JDK version: 25.0.2
  • OS: MacOS Tahoe

Describe the bug

Eclipse Store 4.0.1 has a bug in AbstractCompositeBitmapIndex.internalHandleChanged() (line 528-537).

Root cause: When updating an entity whose composite-indexed field changes from null → non-null:

  1. null produces NULL() sentinel = Object[1]
  2. Non-null Instant produces Object[6] (year/month/day/hour/min/sec)
  3. ensureSubIndices(newKeys) grows the sub-index array from 1 to 6
  4. The loop then calls subIndex.internalHandleChanged(oldKeys, ...) for all 6 sub-indices
  5. Sub-indices at positions 1-5 access oldKeys[position] — but oldKeys has length 1 → ArrayIndexOutOfBoundsException

The fix (in Eclipse Store) should guard internalHandleChanged in AbstractCompositeBitmapIndex to skip sub-indices whose position exceeds oldKeys.length, or pad oldKeys to match newKeys.length.

To Reproduce

See the attached reproducer

SubBitmapIndexHashingBugTest.java

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions