{"record":{"id":"3416ba02775e8457","repo":"quarkusio/quarkus","slug":"unexpected-end-of-input-str","errorCode":null,"errorMessage":"Unexpected end of input: ${str}","messagePattern":"Unexpected end of input: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/types/TypeParser.java","lineNumber":180,"sourceCode":"        try {\n            return Class.forName(token, true, Thread.currentThread().getContextClassLoader());\n        } catch (ClassNotFoundException e) {\n            throw new IllegalArgumentException(\"Unknown class: \" + token, e);\n        }\n    }\n\n    // ---\n\n    private void expect(String expected) {\n        String token = nextToken();\n        if (!expected.equals(token)) {\n            throw unexpected(token);\n        }\n    }\n\n    private IllegalArgumentException unexpected(String token) {\n        if (token.isEmpty()) {\n            throw new IllegalArgumentException(\"Unexpected end of input: \" + str);\n        }\n        return new IllegalArgumentException(\"Unexpected token '\" + token + \"' at position \" + (pos - token.length())\n                + \": \" + str);\n    }\n\n    private String peekToken() {\n        // skip whitespace\n        while (pos < str.length() && Character.isWhitespace(str.charAt(pos))) {\n            pos++;\n        }\n\n        // end of input\n        if (pos == str.length()) {\n            return \"\";\n        }\n\n        int pos = this.pos;\n","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/types/TypeParser.java#L162-L198","documentation":"TypeParser parses Java type signature strings (e.g. 'java.util.List<java.lang.String>') into Jandex type structures. This IllegalArgumentException is thrown by the unexpected() helper when the parser runs out of input while expecting another token, i.e. the type string is truncated/incomplete. The library throws it because a partial type string cannot describe a complete, well-formed type.","triggerScenarios":"Calling TypeParser.parse/parseReferenceType/parsePrimitiveType with a string that terminates where another token is required — e.g. 'java.util.', 'java.util.List<java.util', or 'Lcom/foo/' with the closing segment missing. unexpected(\"\") is invoked when a consumed/peeked token is empty.","commonSituations":"Configuration properties (e.g. quarkus config referencing custom types) where the value was cut off; generated code emitting half-built type signatures; hand-edited annotations like @ConfigMapping signatures that were truncated by templating or string slicing.","solutions":["Print and inspect the full type string reported in the message and locate where it ends prematurely","Complete the type signature (close generics with >, finish package/class name, add array brackets)","Check the code or template that builds the string for truncation (substring, limit, line-wrap)","Validate the string parses as a Java type signature before passing it to TypeParser"],"exampleFix":"// before\nnew TypeParser(\"java.util.List<java.lang.String\").parse();\n// after\nnew TypeParser(\"java.util.List<java.lang.String>\").parse();","handlingStrategy":"validation","validationCode":"boolean isCompleteTypeSignature(String s) {\n    if (s == null || s.isBlank()) return false;\n    int depth = 0;\n    for (char c : s.toCharArray()) {\n        if (c == '<') depth++;\n        if (c == '>') depth--;\n        if (depth < 0) return false;\n    }\n    return depth == 0 && !s.endsWith(\".\") && !s.endsWith(\",\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    new TypeParser(sig).parse();\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Unexpected end of input\")) {\n        throw new IllegalArgumentException(\"Truncated type signature: \" + sig, e);\n    }\n    throw e;\n}","preventionTips":["Always build signatures with helper methods, not raw string concatenation","Balance < > and [ ] brackets programmatically when composing generics","Unit-test every configured type-string before it reaches build time","Log the full signature on failure (the exception already includes it)"],"tags":["type-parser","illegal-argument","parsing"],"backgroundTag":"malformed-type-signature","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"}