JetBrains/intellij-community · error · IllegalStateException
Column number: %d. Error during setting value in nested tabl
Error message
Column number: %d. Error during setting value in nested table row: column number is out of bounds.
What it means
NestedTableRow.setValue(int i, Object object) throws IllegalStateException when the column index i fails isValidColumnIdx for the nested table. It guards the write path (NestedTable.setValueAt) symmetrically with the read path.
Source
Thrown at grid/core-impl/src/datagrid/NestedTablesDataGridModel.java:396
@Override
public @Nullable Object getValue(int columnNum) {
if (!myNestedTable.isValidColumnIdx(columnNum)) {
throw new IllegalStateException(
String.format("Column number: %d. Error during retrieving value from nested table row: column number is out of bounds.",
columnNum));
}
return myNestedTable.getValueAt(myRowIdx, columnNum);
}
@Override
public int getSize() {
return myNestedTable.getColumnsNum();
}
@Override
public void setValue(int i, @Nullable Object object) {
if (!myNestedTable.isValidColumnIdx(i)) {
throw new IllegalStateException(
String.format("Column number: %d. Error during setting value in nested table row: column number is out of bounds.", i));
}
myNestedTable.setValueAt(myRowIdx, i, object);
}
@Override
public int getRowNum() {
return myNestedTable.getRowNum(myRowIdx);
}
}
public static class NestedTableColumn implements GridColumn {
private final int myColumnIdx;
private final NestedTable myNestedTable;
private int myType = Integer.MAX_VALUE;
View on GitHub (pinned to be881553f2)
Solutions
- Validate with table.isValidColumnIdx(i) or i < row.getSize() before committing the edit
- Re-resolve the column index from the current column model at commit time instead of reusing the index captured at edit start
- Discard queued edits when the grid model is refreshed
Example fix
// before
row.setValue(colIdx, newValue);
// after
if (colIdx >= 0 && colIdx < row.getSize()) {
row.setValue(colIdx, newValue);
} Defensive patterns
Strategy: validation
Validate before calling
if (editorColumn >= 0 && editorColumn < row.getSize()) {
row.setValue(editorColumn, newValue);
} else {
// column vanished during editing; discard edit and refresh
} Prevention
- Re-resolve the column index from the live column model at commit time
- Cancel in-flight editors when the grid model is refreshed
- Validate against row.getSize() (nested column count) before every setValue
When it happens
Trigger: An editor committing an edited value via row.setValue(i, value) with i outside 0..getColumnsNum()-1; typically the editor's column index comes from a column model that has drifted from the nested table.
Common situations: Applying an edit after the result set was re-queried and columns changed; applying a stored edit (paste, bulk update) against a newer table snapshot; off-by-one in column loops.
Related errors
- Column number: %d. Error during retrieving value from nested
- Column index: %d. Error during nested table column creation:
- "Given column index " + colIdx + " is not valid."
- The %s does not support rows addition, use another implement
- Row index: %d. Error during nested table row creation: row i
AI-assisted analysis of JetBrains/intellij-community@be881553f2 (2026-08-14).
Data as JSON: /api/errors/cdc06e31a28d629f.
Report an issue: GitHub.