{"record":{"id":"77f9dae62c4a6e85","repo":"quarkusio/quarkus","slug":"expresion-command-must-not-be-a-digit-alphabetic","errorCode":null,"errorMessage":"Expresion command must not be a digit/alphabetic: \" + command","messagePattern":"Expresion command must not be a digit/alphabetic: \" \\+ command","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/qute/core/src/main/java/io/quarkus/qute/ParserConfig.java","lineNumber":34,"sourceCode":"     * By default, no special expression command is used.\n     */\n    public static final ParserConfig DEFAULT = new ParserConfig(null);\n\n    public ParserConfig {\n        if (expressionCommand != null) {\n            char command = expressionCommand.charValue();\n            if (command < 0 || command > 127) {\n                throw new IllegalArgumentException(\"Expresion command must be an ASCII char: \" + command);\n            }\n            if (Parser.Tag.isCommand(command, null)\n                    || command == Parser.COMMENT_DELIMITER\n                    || command == Parser.CDATA_START_DELIMITER\n                    || command == Parser.UNDERSCORE) {\n                throw new IllegalArgumentException(\"Expresion command is reserved: \" + command);\n            }\n            if (Character.isDigit(command)\n                    || Character.isAlphabetic(command)) {\n                throw new IllegalArgumentException(\"Expresion command must not be a digit/alphabetic: \" + command);\n            }\n        }\n    }\n\n}","sourceCodeStart":16,"sourceCodeEnd":39,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/qute/core/src/main/java/io/quarkus/qute/ParserConfig.java#L16-L39","documentation":"Thrown by ParserConfig when the expression command character is a digit or alphabetic character. Expression commands must be punctuation so that identifiers/numbers starting templates remain unambiguous.","triggerScenarios":"Constructing ParserConfig with e.g. 'x', 'e', or '1' as the expression command — Character.isDigit or Character.isAlphabetic returns true.","commonSituations":"Users trying a mnemonic delimiter like 'e' for expression or a numeric char; programmatic config generation accidentally passing a letter from a string like \"expr\".","solutions":["Use a non-alphanumeric, non-digit ASCII punctuation character such as '$'.","Validate before constructing: reject if Character.isDigit(c) || Character.isAlphabetic(c).","If a letter-like look is desired, use a symbol adjacent in meaning, e.g. '$' or '%'."],"exampleFix":"// before\nParserConfig config = new ParserConfig('e'); // alphabetic not allowed\n\n// after\nParserConfig config = new ParserConfig('$'); // punctuation is allowed","handlingStrategy":"validation","validationCode":"char c = command;\nif (Character.isDigit(c) || Character.isAlphabetic(c)) {\n    throw new IllegalArgumentException(\"expression command must be punctuation, got: \" + c);\n}","typeGuard":"static boolean isPunctuation(char c) {\n    return c > 32 && c < 127 && !Character.isDigit(c) && !Character.isAlphabetic(c);\n}","tryCatchPattern":"try {\n    ParserConfig config = new ParserConfig(command);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"digit/alphabetic\")) {\n        // substitute a punctuation char such as '$'\n    }\n}","preventionTips":["Only allow punctuation characters as the expression command","Reject letters/digits at the configuration boundary","Document the constraint wherever the delimiter is configurable"],"tags":["qute","configuration","illegal-argument","delimiter"],"backgroundTag":"invalid-delimiter-char","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}