{"record":{"id":"26ab6fd4aa2e7c53","repo":"JetBrains/intellij-community","slug":"unexpected-position-position","errorCode":null,"errorMessage":"unexpected position: {position}","messagePattern":"unexpected position: (.+?)","errorType":"exception","errorClass":"UnexpectedFormElementException","httpStatus":null,"severity":"error","filePath":"java/compiler/forms-compiler/src/com/intellij/uiDesigner/lw/LwSplitPane.java","lineNumber":39,"sourceCode":"\n  @Override\n  public void read(final Element element, final PropertiesProvider provider) throws Exception {\n    readNoLayout(element, provider);\n  }\n\n  @Override\n  protected void readConstraintsForChild(final Element element, final LwComponent component) {\n    final Element constraintsElement = LwXmlReader.getRequiredChild(element, \"constraints\");\n    final Element splitterChild = LwXmlReader.getRequiredChild(constraintsElement, \"splitpane\");\n    final String position = LwXmlReader.getRequiredString(splitterChild, \"position\");\n    if (\"left\".equals(position)) {\n      component.setCustomLayoutConstraints(POSITION_LEFT);\n    }\n    else if (\"right\".equals(position)) {\n      component.setCustomLayoutConstraints(POSITION_RIGHT);\n    }\n    else {\n      throw new UnexpectedFormElementException(\"unexpected position: \" + position);\n    }\n  }\n}\n","sourceCodeStart":21,"sourceCodeEnd":43,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/java/compiler/forms-compiler/src/com/intellij/uiDesigner/lw/LwSplitPane.java#L21-L43","documentation":"Thrown by LwSplitPane.readConstraintsForChild when reading a child's split-pane constraints: the required 'position' attribute under <constraints><splitpane> is neither 'left' nor 'right'. A JSplitPane child must declare which pane it occupies; any other value is rejected with UnexpectedFormElementException.","triggerScenarios":"A split-pane child's constraints XML reads <splitpane position=\"top\"/> (or \"LEFT\", \"center\", etc.). Only exact lowercase 'left' and 'right' are accepted; anything else, including case variants, throws.","commonSituations":"Hand-editing form XML and typing a wrong or capitalized position value; code that programmatically generates form XML using Swing constants (TOP/BOTTOM) instead of the designer's left/right vocabulary.","solutions":["Set the position attribute to exactly 'left' or 'right' in the child's <constraints><splitpane> element.","Re-open the split pane in the GUI designer and re-drop the component into the correct pane, then save."],"exampleFix":"<!-- before -->\n<constraints><splitpane position=\"LEFT\"/></constraints>\n\n<!-- after -->\n<constraints><splitpane position=\"left\"/></constraints>","handlingStrategy":"validation","validationCode":"// When writing split-pane constraints, normalize the position value\nif (!\"left\".equals(position) && !\"right\".equals(position)) throw new IllegalArgumentException(\"position must be 'left' or 'right', got: \" + position);","typeGuard":null,"tryCatchPattern":"try { splitPane.readConstraintsForChild(element, component); } catch (UnexpectedFormElementException e) { /* set position to exactly 'left' or 'right' (lowercase) */ }","preventionTips":["Use only lowercase 'left'/'right' in splitpane position attributes.","Map Swing constants (LEFT/RIGHT) to lowercase when generating form XML."],"tags":["gui-designer","form-xml","split-pane","constraints"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}