{"record":{"id":"382676453f7d7da6","repo":"antlr/antlr4","slug":"start-cannot-be-null-or-empty","errorCode":null,"errorMessage":"start cannot be null or empty","messagePattern":"start cannot be null or empty","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"runtime/Java/src/org/antlr/v4/runtime/tree/pattern/ParseTreePatternMatcher.java","lineNumber":137,"sourceCode":"\tpublic ParseTreePatternMatcher(Lexer lexer, Parser parser) {\n\t\tthis.lexer = lexer;\n\t\tthis.parser = parser;\n\t}\n\n\t/**\n\t * Set the delimiters used for marking rule and token tags within concrete\n\t * syntax used by the tree pattern parser.\n\t *\n\t * @param start The start delimiter.\n\t * @param stop The stop delimiter.\n\t * @param escapeLeft The escape sequence to use for escaping a start or stop delimiter.\n\t *\n\t * @exception IllegalArgumentException if {@code start} is {@code null} or empty.\n\t * @exception IllegalArgumentException if {@code stop} is {@code null} or empty.\n\t */\n\tpublic void setDelimiters(String start, String stop, String escapeLeft) {\n\t\tif (start == null || start.isEmpty()) {\n\t\t\tthrow new IllegalArgumentException(\"start cannot be null or empty\");\n\t\t}\n\n\t\tif (stop == null || stop.isEmpty()) {\n\t\t\tthrow new IllegalArgumentException(\"stop cannot be null or empty\");\n\t\t}\n\n\t\tthis.start = start;\n\t\tthis.stop = stop;\n\t\tthis.escape = escapeLeft;\n\t}\n\n\t/** Does {@code pattern} matched as rule {@code patternRuleIndex} match {@code tree}? */\n\tpublic boolean matches(ParseTree tree, String pattern, int patternRuleIndex) {\n\t\tParseTreePattern p = compile(pattern, patternRuleIndex);\n\t\treturn matches(tree, p);\n\t}\n\n\t/** Does {@code pattern} matched as rule patternRuleIndex match tree? Pass in a","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/antlr/antlr4/blob/7d5770395bb7b02eb56e7c62662cb1d7c08f42a3/runtime/Java/src/org/antlr/v4/runtime/tree/pattern/ParseTreePatternMatcher.java#L119-L155","documentation":"Error \"start cannot be null or empty\" thrown in antlr/antlr4.","triggerScenarios":"ParseTreePatternMatcher.setStart() called with null or empty string.","commonSituations":"Use a non-empty delimiter such as '<' for setStart; validate user-supplied delimiters before configuring the matcher.","solutions":["Pass a non-null, non-empty start tag name to ParseTreePatternMatcher.setDelimiters(...).","Choose delimiter characters that do not appear literally in your patterns."],"exampleFix":"matcher.setDelimiters(\"<\", \">\", \"$\");","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d5770395bb7b02eb56e7c62662cb1d7c08f42a3","analyzedAt":"2026-08-14T14:47:56.354Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}