{"record":{"id":"1ee6f60a40bba82f","repo":"JetBrains/intellij-community","slug":"attribute-attributename-is-not-a-proper-double","errorCode":null,"errorMessage":"attribute '{attributeName}' is not a proper double: {str}","messagePattern":"attribute '(.+?)' is not a proper double: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"java/compiler/forms-compiler/src/com/intellij/uiDesigner/lw/LwXmlReader.java","lineNumber":97,"sourceCode":"      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);\n    if (str == null) {\n      return defaultValue;\n    }\n    return Boolean.valueOf(str).booleanValue();\n  }\n\n  public static double getRequiredDouble(final Element element, final String attributeName) {\n    final String str = getRequiredString(element, attributeName);\n    try {\n      return Double.parseDouble(str);\n    }\n    catch (NumberFormatException e) {\n      throw new IllegalArgumentException(\"attribute '\" + attributeName + \"' is not a proper double: \" + str);\n    }\n  }\n\n  static double getOptionalDouble(final Element element, final String attributeName, double defaultValue) {\n    final String str = element.getAttributeValue(attributeName);\n    if (str == null) {\n      return defaultValue;\n    }\n    try {\n      return Double.parseDouble(str);\n    }\n    catch (NumberFormatException e) {\n      throw new IllegalArgumentException(\"attribute '\" + attributeName + \"' is not a proper double: \" + str);\n    }\n  }\n\n  public static float getRequiredFloat(final Element element, final String attributeName) {\n    final String str = getRequiredString(element, attributeName);","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/java/compiler/forms-compiler/src/com/intellij/uiDesigner/lw/LwXmlReader.java#L79-L115","documentation":"Thrown by LwXmlReader.getRequiredDouble when a required attribute cannot be parsed by Double.parseDouble. Double attributes appear in form XML for things like proportional grid layout weights/floats in some serializers; a malformed value triggers IllegalArgumentException with the attribute name and the bad string.","triggerScenarios":"A form-XML attribute read via getRequiredDouble holds a non-double string — e.g. \"big\", \"1,5\" (comma separator), \"50%\", or empty. Integer.parseInt-style errors are not the issue here; any string Double.parseDouble rejects (including trailing text) throws.","commonSituations":"Locale-sensitive editing inserting decimal commas; hand-edited forms adding units or symbolic names; generators emitting formatted numbers with grouping separators.","solutions":["Write the value as a plain dot-decimal literal, e.g. weight=\"0.5\".","Remove thousands separators, units, and percent signs from numeric attributes.","Re-save the form from the designer to regenerate canonical numbers."],"exampleFix":"<!-- before -->\n<column weight=\"50%\"/>\n\n<!-- after -->\n<column weight=\"0.5\"/>","handlingStrategy":"validation","validationCode":"// Validate double format (dot decimal, optional exponent) before parse\nif (!str.trim().matches(\"-?\\\\d+(\\\\.\\\\d+)?([eE][+-]?\\\\d+)?\")) throw new IllegalStateException(\"'\" + attr + \"' must be a double, got: \" + str);","typeGuard":null,"tryCatchPattern":"try { LwXmlReader.getRequiredDouble(element, attr); } catch (IllegalArgumentException e) { if (e.getMessage().contains(\"not a proper double\")) { /* use dot-decimal, strip units/percent/locale commas */ } else throw e; }","preventionTips":["Write decimals with a dot, never a comma or percent.","Do not paste localized numbers from spreadsheets into form XML."],"tags":["gui-designer","form-xml","number-format","double"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}