{"record":{"id":"2324ec3dd60d42db","repo":"antlr/antlr4","slug":"stop-cannot-be-null-or-empty","errorCode":null,"errorMessage":"stop cannot be null or empty","messagePattern":"stop 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":141,"sourceCode":"\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\n\t *  compiled pattern instead of a string representation of a tree pattern.\n\t */\n\tpublic boolean matches(ParseTree tree, ParseTreePattern pattern) {\n\t\tMultiMap<String, ParseTree> labels = new MultiMap<String, ParseTree>();","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/antlr/antlr4/blob/7d5770395bb7b02eb56e7c62662cb1d7c08f42a3/runtime/Java/src/org/antlr/v4/runtime/tree/pattern/ParseTreePatternMatcher.java#L123-L159","documentation":"Error \"stop cannot be null or empty\" thrown in antlr/antlr4.","triggerScenarios":"ParseTreePatternMatcher.setStop() called with null or empty string.","commonSituations":"Use a non-empty delimiter such as '>' for setStop; validate delimiters differ and are non-empty.","solutions":["Pass a non-null, non-empty stop tag name to ParseTreePatternMatcher.setDelimiters(...).","Ensure the stop delimiter differs from the start delimiter."],"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"}