{"record":{"id":"a70737a4d7747b99","repo":"quarkusio/quarkus","slug":"missing-at-the-end-of-input-in-glob-s","errorCode":null,"errorMessage":"Missing } at the end of input in glob %s","messagePattern":"Missing \\} at the end of input in glob (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/app-model/src/main/java/io/quarkus/util/GlobUtil.java","lineNumber":132,"sourceCode":"    private static int alternation(String glob, int i, int length, StringBuilder result) {\n        result.append(\"(?:\");\n        while (i < length) {\n            char current = glob.charAt(i++);\n            switch (current) {\n                case '}':\n                    result.append(')');\n                    return i;\n                case ',':\n                    result.append('|');\n                    i = glob(glob, i, length, \",}\", result);\n                    break;\n                default:\n                    i--;\n                    i = glob(glob, i, length, \",}\", result);\n                    break;\n            }\n        }\n        throw new IllegalStateException(String.format(\"Missing } at the end of input in glob %s\", glob));\n    }\n\n    private static int unescape(String glob, int i, int length, StringBuilder result, boolean charClass) {\n        if (i < length) {\n            final char current = glob.charAt(i++);\n            if (charClass) {\n                escapeCharClassIfNeeded(current, result);\n            } else {\n                escapeIfNeeded(current, result);\n            }\n            return i;\n        } else {\n            throw new IllegalStateException(\n                    String.format(\"Incomplete escape sequence at the end of input in glob %s\", glob));\n        }\n    }\n\n    private static int charClass(String glob, int i, int length, StringBuilder result) {","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/util/GlobUtil.java#L114-L150","documentation":"GlobUtil's alternation parser ({a,b,c}) throws IllegalStateException when the glob input ends while still inside an unclosed '{' block. The recursive glob() walker consumed the entire input without finding the closing '}'. This indicates a syntactically malformed brace expression.","triggerScenarios":"Passing a glob pattern to GlobUtil with '{' but no matching '}', e.g. 'src/{main,test' or 'a{b,c{d,e}' where an inner closing brace is missing.","commonSituations":"Hand-written Ant-style patterns in configuration (quarkus properties, resource includes/excludes) with a typo'd or truncated brace; patterns built by string concatenation that dropped the closing '}'; copying a partial pattern from documentation.","solutions":["Close every '{' with a matching '}': 'src/{main,test}' not 'src/{main,test'","Count braces in the pattern (equal numbers of '{' and '}') before using it","If alternation was unintended, remove the '{' or escape it as '\\{'"],"exampleFix":"// before\nGlobUtil.toRegexPattern(\"src/{main,test\");\n// after\nGlobUtil.toRegexPattern(\"src/{main,test}\");","handlingStrategy":"validation","validationCode":"static boolean bracesBalanced(String glob) {\n    int depth = 0;\n    for (int i = 0; i < glob.length(); i++) {\n        if (glob.charAt(i) == '\\\\') { i++; continue; }\n        char c = glob.charAt(i);\n        if (c == '{') depth++;\n        else if (c == '}' && --depth < 0) return false;\n    }\n    return depth == 0;\n}","typeGuard":null,"tryCatchPattern":"try {\n    return GlobUtil.toRegexPattern(glob);\n} catch (IllegalStateException e) {\n    if (e.getMessage().startsWith(\"Missing }\")) {\n        throw new IllegalArgumentException(\"Unclosed '{' in glob: \" + glob, e);\n    }\n    throw e;\n}","preventionTips":["Check '{' and '}' are balanced (outside escapes) before installing glob patterns from config","Escape literal braces as '\\{' when alternation is not intended","Keep patterns in config files as raw strings and avoid concatenation that can drop characters"],"tags":["glob","parsing","configuration"],"backgroundTag":"unclosed-glob-brace","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}