{"record":{"id":"1d0aebf9a45049b0","repo":"JetBrains/intellij-community","slug":"the-s-does-not-support-rows-addition-use-another","errorCode":null,"errorMessage":"The %s does not support rows addition, use another implementation instead.","messagePattern":"The (.+?) does not support rows addition, use another implementation instead\\.","errorType":"validation","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"grid/core-impl/src/datagrid/StaticNestedTable.java","lineNumber":101,"sourceCode":"\n  @Override\n  public String getColumnTypeName(int colIdx) {\n    if (!isValidColumnIdx(colIdx)) {\n      throw new IllegalStateException(\"Given column index \" + colIdx + \" is not valid.\");\n    }\n\n    TypeMerger merger = determineColumnType(myRowsValues, new int[] { colIdx });\n    return merger.getName();\n  }\n\n  @Override\n  public String getColumnName(int colIdx) {\n    return myColumnsHierarchy.getChildren().get(colIdx).getName();\n  }\n\n  @Override\n  public void addRow(GridRow value) {\n    throw new IllegalStateException(\n      format(\"The %s does not support rows addition, use another implementation instead.\", this.getClass().getSimpleName())\n    );\n  }\n\n  @Override\n  public @NotNull Iterator<Map<String, Object>> iterator() {\n    return new JBIterator<>() {\n      private int myNextValueIdx;\n\n      @Override\n      protected Map<String, Object> nextImpl() {\n        return myNextValueIdx < getRowsNum() ? toMap(myNextValueIdx++) : stop();\n      }\n    };\n  }\n\n  private Map<String, Object> toMap(int rowIdx) {\n    ColumnNamesHierarchyNode root = myColumnsHierarchy;","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/grid/core-impl/src/datagrid/StaticNestedTable.java#L83-L119","documentation":"StaticNestedTable.addRow(GridRow) always throws IllegalStateException because a static nested table is an immutable snapshot of a query result; rows cannot be appended. The message tells you to use a mutable NestedTable implementation instead.","triggerScenarios":"Any call to addRow on a StaticNestedTable instance, e.g. generic editing/paste code that treats every NestedTable uniformly and attempts to append a new record.","commonSituations":"Grid editing framework trying to insert a new row into a read-only result set; code written against a mutable table implementation later receiving the static one; paste/append actions enabled on a non-editable grid.","solutions":["Disable row insertion (and append/paste-new-row actions) for grids backed by StaticNestedTable","Branch on mutability before addRow and use a mutable NestedTable implementation for editable datasets","Catch IllegalStateException at the action level and report 'read-only result set' to the user instead of crashing"],"exampleFix":"// before\ntable.addRow(newRow);\n\n// after\nif (table.isEditable()) { // or instanceof check for a mutable NestedTable\n  table.addRow(newRow);\n} else {\n  notifyReadOnly();\n}","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"boolean isAppendable(NestedTable t) { return !(t instanceof StaticNestedTable); }","tryCatchPattern":"catch (IllegalStateException e) if message contains 'does not support rows addition': surface a read-only notification; do not retry","preventionTips":["Check the grid's editability before enabling insert/paste-new-row actions","Treat StaticNestedTable as an immutable view of a query result","Branch on the concrete NestedTable implementation before mutation APIs"],"tags":["grid","nested-table","immutable","editing","intellij"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}