{"record":{"id":"c8f62de68f682eb3","repo":"JetBrains/intellij-community","slug":"attribute-attributename-is-not-a-proper-intege","errorCode":null,"errorMessage":"attribute '{attributeName}' is not a proper integer: {str}","messagePattern":"attribute '(.+?)' is not a proper integer: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"java/compiler/forms-compiler/src/com/intellij/uiDesigner/lw/LwXmlReader.java","lineNumber":66,"sourceCode":"      return value;\n    }\n    else{\n      throw new IllegalArgumentException(\"attribute '\" + attributeName + \"' is required: \"+element);\n    }\n  }\n\n  static String getOptionalString(final Element element, final String attributeName, final String defaultValue) {\n    final String value = element.getAttributeValue(attributeName);\n    return value != null ? value.trim() : defaultValue;\n  }\n\n  public static int getRequiredInt(final Element element, final String attributeName) {\n    final String str = getRequiredString(element, attributeName);\n    try {\n      return Integer.parseInt(str);\n    }\n    catch (NumberFormatException e) {\n      throw new IllegalArgumentException(\"attribute '\" + attributeName + \"' is not a proper integer: \" + str);\n    }\n  }\n\n  static int getOptionalInt(final Element element, final String attributeName, final int defaultValue) {\n    final String str = element.getAttributeValue(attributeName);\n    if (str == null) {\n      return defaultValue;\n    }\n    try {\n      return Integer.parseInt(str);\n    }\n    catch (NumberFormatException e) {\n      throw new IllegalArgumentException(\"attribute '\" + attributeName + \"' is not a proper integer: \" + str);\n    }\n  }\n\n  public static boolean getOptionalBoolean(final Element element, final String attributeName, final boolean defaultValue) {\n    final String str = element.getAttributeValue(attributeName);","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/java/compiler/forms-compiler/src/com/intellij/uiDesigner/lw/LwXmlReader.java#L48-L84","documentation":"Thrown by LwXmlReader.getRequiredInt when a required attribute's trimmed value cannot be parsed by Integer.parseInt. Grid layout metadata (row/column size, indentation, span counts, minimum size values) is stored as integer attributes; a non-numeric or malformed value fails with IllegalArgumentException naming the attribute and the bad string.","triggerScenarios":"A form-XML attribute read via getRequiredInt contains a non-integer, e.g. <row height=\"auto\"/> or <grid row=\"1.5\"/>, or whitespace-only after trimming, or a value with a unit suffix like \"20px\".","commonSituations":"Hand-editing form files and replacing numeric layout attributes with descriptive text; scripts templating forms with placeholder tokens left in numeric fields; locale-related edits inserting comma decimal separators into integer fields.","solutions":["Set the attribute named in the message to a plain integer literal (e.g. height=\"20\").","If the value was meant to be computed/sized, use the designer's own sizing flags instead of custom text.","Re-save the form from the GUI designer to restore canonical numeric values."],"exampleFix":"<!-- before -->\n<row height=\"auto\"/>\n\n<!-- after -->\n<row height=\"20\" resizable=\"true\"/>","handlingStrategy":"validation","validationCode":"// Before parsing int attributes from generated XML\nif (!str.trim().matches(\"-?\\\\d+\")) throw new IllegalStateException(\"Attribute '\" + attr + \"' must be an integer, got: \" + str);","typeGuard":null,"tryCatchPattern":"try { LwXmlReader.getRequiredInt(element, attr); } catch (IllegalArgumentException e) { if (e.getMessage().contains(\"not a proper integer\")) { /* replace symbolic/unit value with a plain integer */ } else throw e; }","preventionTips":["Use plain integer literals in layout attributes; no units, no 'auto'.","Run generated forms through the designer before committing."],"tags":["gui-designer","form-xml","number-format","grid-layout"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}