{"record":{"id":"e14c7f1b5edb1fa1","repo":"JetBrains/intellij-community","slug":"row-d-access-failed-s","errorCode":null,"errorMessage":"Row %d access failed: %s","messagePattern":"Row (.+?) access failed: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"grid/core-impl/src/datagrid/HierarchicalColumnsDataGridModel.java","lineNumber":420,"sourceCode":"  private static void validateHierarchicalIndex(int[] hierarchicalIdx, int rowNum) {\n    if (hierarchicalIdx == null) {\n      throw new IllegalArgumentException(\n        String.format(\"Row %d failed: hierarchicalIdx cannot be null\", rowNum)\n      );\n    }\n\n    if (hierarchicalIdx.length == 0) {\n      throw new IllegalArgumentException(\n        String.format(\"Row %d access failed: hierarchicalIdx cannot be empty\", rowNum)\n      );\n    }\n  }\n\n  private static @Nullable Object tryExtractValueByHierarchicalIndex(Object[] topLevelValues, int[] hierarchicalIdx, int rowNum) {\n    try {\n      return extractValueByHierarchicalIndex(topLevelValues, hierarchicalIdx);\n    } catch (IndexOutOfBoundsException | NullPointerException | IllegalArgumentException e) {\n      throw new RuntimeException(String.format(\"Row %d access failed: %s\", rowNum, e.getMessage()), e);\n    }\n  }\n\n  public static Object extractValueByHierarchicalIndex(Object[] topLevelValues, int[] hierarchicalIdx) {\n    Object result = null;\n    Object[] data = topLevelValues;\n    for (int i = 0; i < hierarchicalIdx.length; ++i) {\n      int idx = hierarchicalIdx[i];\n      if (idx < 0 || idx >= data.length) {\n        throw new IndexOutOfBoundsException(\n          String.format(\n            \"Access by hierarchical idx %s failed: Index out of bounds at element by path %s\",\n            Arrays.toString(hierarchicalIdx),\n            Arrays.toString(Arrays.copyOfRange(hierarchicalIdx, 0, i))\n          )\n        );\n      }\n","sourceCodeStart":402,"sourceCodeEnd":438,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/grid/core-impl/src/datagrid/HierarchicalColumnsDataGridModel.java#L402-L438","documentation":"tryExtractValueByHierarchicalIndex wraps IndexOutOfBoundsException, NullPointerException and IllegalArgumentException from extractValueByHierarchicalIndex into a RuntimeException prefixed with 'Row %d access failed: %s'. It preserves the cause, so the chained message describes the real traversal failure (out-of-bounds level, null intermediate element, or unsupported collection).","triggerScenarios":"Any hierarchical getValue call whose path does not match the row's actual nested value structure — stale path after row schema changed, path deeper than the data, or intermediate nulls. The original exception's message is embedded in this wrapper's message.","commonSituations":"Mixed-shape rows (some rows have nested arrays, others flat values); columns restructured while cached paths persist; CSV reload changing nesting depth.","solutions":["Read getCause()/the suffix of the message to identify the underlying failure (bounds, null element, bad collection) and fix that condition.","Recompute hierarchical paths from the current columns model instead of caching them across reloads.","Normalize row data so every row has the same nesting shape before display."],"exampleFix":"// before\nObject v = getValue(row, stalePath);\n\n// after\ntry {\n  Object v = getValue(row, column.getHierarchicalIdx());\n} catch (RuntimeException e) {\n  LOG.warn(\"hierarchical access failed for row \" + row.getRowNum(), e.getCause());\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  Object v = model.getValue(row, path);\n} catch (RuntimeException e) {\n  Throwable cause = e.getCause() != null ? e.getCause() : e;\n  LOG.warn(\"row \" + row.getRowNum() + \" path \" + Arrays.toString(path) + \" failed: \" + cause.getMessage());\n}","preventionTips":["Inspect the cause chain; the suffix names the real failure.","Recompute paths from the current column hierarchy before each access."],"tags":["datagrid","hierarchical-columns","wrapper-exception","traversal"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}