Sitelet https://github.com/gephi/gephi/pull/3206
Skip to content

Fix IllegalArgumentException in Search/Replace when columns have been deleted - #3206

Merged
mbastian merged 1 commit into
masterfrom
fix/search-replace-column-index
May 9, 2026
Merged

mbastian merged 1 commit into
masterfrom
fix/search-replace-column-index

Conversation

@mbastian

@mbastian mbastian commented May 9, 2026

Copy link
Copy Markdown
Member

Summary

  • ColumnStore stores columns in a sparse array where deleted column slots become null and are recycled via a garbageQueue. This means column indices are not contiguous after any deletion.
  • findOnNodes and findOnEdges used table.countColumns() as the loop upper bound and called table.getColumn(columnIndex) with a sequential counter. When a gap existed within 0..countColumns()-1, getColumnByIndex threw IllegalArgumentException: The column doesnt exist.
  • A secondary bug: columnsToSearch holds actual column store indices (from column.getIndex()), but the filter check compared them against the sequential loop counter — silently wrong after any deletion.

Fix

  • Replaced index-based iteration with table.toArray(), which returns a compact, gap-free snapshot of active columns.
  • Use column.getIndex() for the columnsToSearch filter check and for foundColumnIndex stored in SearchResult (used by callers such as canReplace, replace, and SearchReplaceUI to call table.getColumn()).
  • The startingColumn state (loop position for resuming iteration) continues to use the position within the toArray() snapshot, which is the correct semantic.

Reproducer

  1. Open a graph with columns
  2. Delete a column (leaving a gap in the store index space)
  3. Open Data Laboratory → Search/Replace and run a search
  4. → IllegalArgumentException: The column doesnt exist

Made with Cursor

Column indices in the store are not contiguous after deletions, so using
countColumns() as the upper bound for sequential index-based access could
hit null slots and throw. Switch to table.toArray() for a gap-free snapshot
and use column.getIndex() for the stored foundColumnIndex and columnsToSearch
filter, which previously also compared wrong values (loop position vs store index).

Co-authored-by: Cursor <cursoragent@cursor.com>
@mbastian mbastian added this to the 0.11.2 milestone May 9, 2026
@mbastian
mbastian merged commit 67454c1 into master May 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant