{"record":{"id":"6f2ce07b7e3471ea","repo":"alibaba/arthas","slug":"line-range-syntax-is-not-supported-in-the-first-ve","errorCode":null,"errorMessage":"Line range syntax is not supported in the first version: {}","messagePattern":"Line range syntax is not supported in the first version: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"warning","filePath":"core/src/main/java/com/taobao/arthas/core/command/monitor200/LineCommand.java","lineNumber":288,"sourceCode":"    }\n\n    static Set<Integer> parseLines(List<String> lineSpecs) {\n        if (lineSpecs == null || lineSpecs.isEmpty()) {\n            throw new IllegalArgumentException(\"The --line option is required unless --list-lines is used.\");\n        }\n        Set<Integer> result = new LinkedHashSet<Integer>();\n        for (String lineSpec : lineSpecs) {\n            if (StringUtils.isEmpty(lineSpec)) {\n                continue;\n            }\n            String[] parts = lineSpec.split(\",\");\n            for (String part : parts) {\n                String value = part.trim();\n                if (value.length() == 0) {\n                    continue;\n                }\n                if (value.indexOf('-') >= 0) {\n                    throw new IllegalArgumentException(\"Line range syntax is not supported in the first version: \"\n                            + value);\n                }\n                final int lineNumber;\n                try {\n                    lineNumber = Integer.parseInt(value);\n                } catch (NumberFormatException e) {\n                    throw new IllegalArgumentException(\"Invalid line number: \" + value);\n                }\n                if (lineNumber <= 0) {\n                    throw new IllegalArgumentException(\"Line number must be greater than 0: \" + value);\n                }\n                result.add(lineNumber);\n                if (result.size() > MAX_LINE_COUNT) {\n                    throw new IllegalArgumentException(\"Too many line numbers, maximum is \" + MAX_LINE_COUNT + \".\");\n                }\n            }\n        }\n        if (result.isEmpty()) {","sourceCodeStart":270,"sourceCodeEnd":306,"githubUrl":"https://github.com/alibaba/arthas/blob/21cf2e9ba52b305290be7223b980ff504bb9cb5b/core/src/main/java/com/taobao/arthas/core/command/monitor200/LineCommand.java#L270-L306","documentation":"Thrown as IllegalArgumentException by LineCommand.parseLines when a line-spec value contains a dash ('-'), indicating a range (e.g. '10-20'). Range syntax is intentionally not implemented in this first version of the command — only discrete, comma-separated single line numbers are accepted. The offending value is echoed.","triggerScenarios":"Pass a --line value using range syntax such as '10-20', '5-10', or any token containing '-'. The indexOf('-') check trips before numeric parsing.","commonSituations":"User assumes range syntax is supported (common in other tools' breakpoint commands); copy-paste of a range from documentation of a different tool.","solutions":["Replace the range with an explicit comma-separated list of single lines (e.g. '10,11,12,...,20').","If you need many lines, generate the comma list programmatically.","Check release notes for a newer Arthas version that may have added range support."],"exampleFix":"// before\nline com.example.Foo --line 10-20\n\n// after\nline com.example.Foo --line 10,11,12,13,14,15,16,17,18,19,20","handlingStrategy":"validation","validationCode":"if (value.indexOf('-') >= 0) {\n    // expand to a comma-separated list of single lines before passing to parseLines\n}","typeGuard":"static boolean isDiscreteLineSpec(String s) { return s != null && s.indexOf('-') < 0; }","tryCatchPattern":"try { Set<Integer> lines = LineCommand.parseLines(lineSpecs); } catch (IllegalArgumentException e) { // expand ranges into explicit lists }","preventionTips":["Use comma-separated single line numbers, not ranges.","Generate the comma list programmatically when many lines are needed.","Check release notes for newer versions that may support range syntax."],"tags":["line-command","user-input","parsing","unsupported-syntax"],"backgroundTag":null,"analyzedSha":"21cf2e9ba52b305290be7223b980ff504bb9cb5b","analyzedAt":"2026-08-14T00:57:07.243Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}