{"record":{"id":"ed10c58b8aca7fc7","repo":"JetBrains/intellij-community","slug":"column-number-d-error-during-retrieving-value-f","errorCode":null,"errorMessage":"Column number: %d. Error during retrieving value from nested table row: column number is out of bounds.","messagePattern":"Column number: (.+?)\\. Error during retrieving value from nested table row: column number is out of bounds\\.","errorType":"validation","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"grid/core-impl/src/datagrid/NestedTablesDataGridModel.java","lineNumber":381,"sourceCode":"\n  public static class NestedTableRow implements GridRow {\n    private final int myRowIdx;\n\n    private final NestedTable myNestedTable;\n\n    NestedTableRow(int rowIdx, NestedTable table) {\n      myNestedTable = table;\n      if (!myNestedTable.isValidRowIdx(rowIdx)) {\n        throw new IllegalStateException(\n          String.format(\"Row index: %d. Error during nested table row creation: row index is invalid.\", rowIdx));\n      }\n      myRowIdx = rowIdx;\n    }\n\n    @Override\n    public @Nullable Object getValue(int columnNum) {\n      if (!myNestedTable.isValidColumnIdx(columnNum)) {\n        throw new IllegalStateException(\n          String.format(\"Column number: %d. Error during retrieving value from nested table row: column number is out of bounds.\",\n                        columnNum));\n      }\n      return myNestedTable.getValueAt(myRowIdx, columnNum);\n    }\n\n    @Override\n    public int getSize() {\n      return myNestedTable.getColumnsNum();\n    }\n\n    @Override\n    public void setValue(int i, @Nullable Object object) {\n      if (!myNestedTable.isValidColumnIdx(i)) {\n        throw new IllegalStateException(\n          String.format(\"Column number: %d. Error during setting value in nested table row: column number is out of bounds.\", i));\n      }\n      myNestedTable.setValueAt(myRowIdx, i, object);","sourceCodeStart":363,"sourceCodeEnd":399,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/grid/core-impl/src/datagrid/NestedTablesDataGridModel.java#L363-L399","documentation":"NestedTableRow.getValue(int columnNum) throws IllegalStateException when columnNum fails myNestedTable.isValidColumnIdx, i.e. the requested column does not exist in the nested table. The wrapper refuses to forward the read to NestedTable.getValueAt with a bad index.","triggerScenarios":"Calling GridRow.getValue(columnNum) where columnNum < 0 or columnNum >= table.getColumnsNum(); e.g. renderer/editor querying a column number from an outer/parent model against a nested-table row.","commonSituations":"Column model and nested table out of sync after a column was removed; using the parent grid's column count to iterate a nested row; stale column index captured before a refresh.","solutions":["Always bound iterations by row.getSize() (which returns the nested table's column count) instead of the outer model's column count","Call myNestedTable.isValidColumnIdx(columnNum) (or row.getSize() check) before getValue","Refresh the column model together with the nested table data so indexes stay consistent"],"exampleFix":"// before\nObject v = row.getValue(colIdx);\n\n// after\nObject v = colIdx >= 0 && colIdx < row.getSize() ? row.getValue(colIdx) : null;","handlingStrategy":"validation","validationCode":"Object safeGet(GridRow row, int columnNum) {\n  return (columnNum >= 0 && columnNum < row.getSize()) ? row.getValue(columnNum) : null;\n}","typeGuard":null,"tryCatchPattern":"catch (IllegalStateException e) when(e.getMessage()!=null && e.getMessage().contains(\"retrieving value from nested table row\")): log and return null for that cell","preventionTips":["Always size column loops from row.getSize() (the nested table's column count), not the outer model's","Refresh column wrappers and row wrappers from the same table snapshot","Renderers should tolerate null for out-of-range columns instead of throwing"],"tags":["grid","nested-table","column-index","intellij"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}