JetBrains/intellij-community · error · IllegalStateException
Column index: %d. Error during nested table column creation:
Error message
Column index: %d. Error during nested table column creation: column index is out of bounds.
What it means
The NestedTableColumn constructor throws IllegalStateException when the given column index fails NestedTable.isValidColumnIdx (negative or >= getColumnsNum()). It prevents creating a GridColumn wrapper for a column the nested table does not have.
Source
Thrown at grid/core-impl/src/datagrid/NestedTablesDataGridModel.java:420
@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;
private String myTypeName = null;
NestedTableColumn(int columnIdx, NestedTable table) {
myNestedTable = table;
if (!myNestedTable.isValidColumnIdx(columnIdx)) {
throw new IllegalStateException(
String.format("Column index: %d. Error during nested table column creation: column index is out of bounds.", columnIdx));
}
myColumnIdx = columnIdx;
}
@Override
public int getColumnNumber() {
return myColumnIdx;
}
@Override
public int getType() {
if (myType == Integer.MAX_VALUE) {
myType = myNestedTable.getColumnType(myColumnIdx);
}
return myType;
}
View on GitHub (pinned to be881553f2)
Solutions
- Check table.isValidColumnIdx(columnIdx) before constructing NestedTableColumn
- Rebuild column wrappers from the same table snapshot used to read getColumnsNum()
- Handle the zero-column nested table case explicitly instead of wrapping columns unconditionally
Example fix
// before
GridColumn col = new NestedTablesDataGridModel.NestedTableColumn(idx, table);
// after
if (table.isValidColumnIdx(idx)) {
GridColumn col = new NestedTablesDataGridModel.NestedTableColumn(idx, table);
} Defensive patterns
Strategy: validation
Validate before calling
if (table.isValidColumnIdx(columnIdx)) {
GridColumn col = new NestedTablesDataGridModel.NestedTableColumn(columnIdx, table);
} Prevention
- Build column wrappers in the same pass that reads getColumnsNum()
- Handle empty nested tables (0 columns) explicitly
- Remember indexes are flat positions under the columns hierarchy, not hierarchy node ids
When it happens
Trigger: Constructing new NestedTableColumn(columnIdx, table) with columnIdx < 0 or >= table.getColumnsNum(); common when a column-model builder iterates a stale column count or the nested table has zero columns.
Common situations: Column hierarchy (StaticNestedTable columns) changed between building the column list and wrapping columns; empty nested table while code assumes at least one column; index confusion between hierarchical column position and flat column number.
Related errors
- Column number: %d. Error during retrieving value from nested
- Column number: %d. Error during setting value in nested tabl
- "Given column index " + colIdx + " is not valid."
- Row index: %d. Error during nested table row creation: row i
- The %s does not support rows addition, use another implement
AI-assisted analysis of JetBrains/intellij-community@be881553f2 (2026-08-14).
Data as JSON: /api/errors/fde7ece56d061a3b.
Report an issue: GitHub.