{"record":{"id":"c410c789fc078793","repo":"JetBrains/intellij-community","slug":"cannot-find-group-groupname","errorCode":null,"errorMessage":"Cannot find group {groupName}","messagePattern":"Cannot find group (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"java/compiler/forms-compiler/src/com/intellij/uiDesigner/lw/LwRootContainer.java","lineNumber":113,"sourceCode":"    for (LwButtonGroup group : myButtonGroups) {\n      final String[] ids = group.getComponentIds();\n      for (String id : ids) {\n        if (id.equals(component.getId())) {\n          return group.getName();\n        }\n      }\n    }\n    return null;\n  }\n\n  @Override\n  public String[] getButtonGroupComponentIds(String groupName) {\n    for (LwButtonGroup group : myButtonGroups) {\n      if (group.getName().equals(groupName)) {\n        return group.getComponentIds();\n      }\n    }\n    throw new IllegalArgumentException(\"Cannot find group \" + groupName);\n  }\n\n  @Override\n  public boolean isInspectionSuppressed(final String inspectionId, final String componentId) {\n    for (LwInspectionSuppression suppression : myInspectionSuppressions) {\n      if ((suppression.getComponentId() == null || suppression.getComponentId().equals(componentId)) &&\n          suppression.getInspectionId().equals(inspectionId)) {\n        return true;\n      }\n    }\n    return false;\n  }\n\n  public LwInspectionSuppression[] getInspectionSuppressions() {\n    return myInspectionSuppressions.toArray(LwInspectionSuppression.EMPTY_ARRAY);\n  }\n}\n","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/java/compiler/forms-compiler/src/com/intellij/uiDesigner/lw/LwRootContainer.java#L95-L131","documentation":"Thrown by LwRootContainer.getButtonGroupComponentIds when no registered LwButtonGroup has the requested name. Button groups are declared in the form's button-groups section; queries for a group that was never declared (or was renamed) are programming/data errors and fail fast with IllegalArgumentException instead of returning null.","triggerScenarios":"Calling getButtonGroupComponentIds(groupName) where groupName does not equal any group name in myButtonGroups — e.g. a component references buttongroup=\"myGroup\" but the <button-groups> section lacks a <group name=\"myGroup\"> entry, or the group was renamed in the designer without updating references.","commonSituations":"Form XML edited by hand: a radio button's buttongroup attribute points to a group that is not declared; groups removed in the designer while components still reference them; tooling that reads form files querying group names by convention.","solutions":["Open the .form XML and add a <group name=\"...\"/> entry under <button-groups> matching the name referenced by the component.","Or remove/fix the buttongroup attribute on components referencing the missing group.","Re-open the form in the GUI designer so it reconciles button-group declarations with component references."],"exampleFix":"<!-- before -->\n<radiobutton id=\"rb1\" buttongroup=\"mode\"/>\n<button-groups/> \n\n<!-- after -->\n<radiobutton id=\"rb1\" buttongroup=\"mode\"/>\n<button-groups>\n  <group name=\"mode\">\n    <button id=\"rb1\"/>\n  </group>\n</button-groups>","handlingStrategy":"validation","validationCode":"// Check the group exists before querying component ids\nboolean exists = rootContainer.getButtonGroups().stream().anyMatch(g -> g.getName().equals(groupName));\nif (!exists) throw new IllegalArgumentException(\"Undeclared button group: \" + groupName);","typeGuard":null,"tryCatchPattern":"try { ids = root.getButtonGroupComponentIds(groupName); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith(\"Cannot find group\")) { /* declare the group in button-groups or fix the reference */ } else throw e; }","preventionTips":["Declare every button group referenced by radio buttons in the form's button-groups section.","When renaming a group in the designer, let it update member references."],"tags":["gui-designer","form-xml","button-groups","illegal-argument"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}