{"record":{"id":"744d27133881eff3","repo":"alibaba/arthas","slug":"class-pattern-is-expected-please-type-the-wildcar","errorCode":null,"errorMessage":"Class-pattern is expected, please type the wildcard expression to match","messagePattern":"Class-pattern is expected, please type the wildcard expression to match","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/com/taobao/arthas/core/command/monitor200/TimeTunnelCommand.java","lineNumber":261,"sourceCode":"\n    /**\n     * 检查参数是否合法\n     */\n    private void checkArguments() {\n        String validateError = validateSizeLimit(sizeLimit);\n        if (validateError != null) {\n            throw new IllegalArgumentException(validateError);\n        }\n\n        // 检查d/p参数是否有i参数配套\n        if ((isDelete || isPlay) && null == index) {\n            throw new IllegalArgumentException(\"Time fragment index is expected, please type -i to specify\");\n        }\n\n        // 在t参数下class-pattern,method-pattern\n        if (isTimeTunnel) {\n            if (StringUtils.isEmpty(classPattern)) {\n                throw new IllegalArgumentException(\"Class-pattern is expected, please type the wildcard expression to match\");\n            }\n            if (StringUtils.isEmpty(methodPattern)) {\n                throw new IllegalArgumentException(\"Method-pattern is expected, please type the wildcard expression to match\");\n            }\n        }\n\n        // 一个参数都没有是不行滴\n        if (null == index && !isTimeTunnel && !isDeleteAll && StringUtils.isEmpty(watchExpress)\n                && !isList && StringUtils.isEmpty(searchExpress)) {\n            throw new IllegalArgumentException(\"Argument(s) is/are expected, type 'help tt' to read usage\");\n        }\n    }\n\n    /*\n     * 记录时间片段\n     */\n    int putTimeTunnel(TimeFragment tt) {\n        int indexOfSeq = sequence.getAndIncrement();","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/alibaba/arthas/blob/21cf2e9ba52b305290be7223b980ff504bb9cb5b/core/src/main/java/com/taobao/arthas/core/command/monitor200/TimeTunnelCommand.java#L243-L279","documentation":"Thrown by checkArguments() in the `tt` command when the record mode (-t) is active but no class-pattern is provided. Time-tunnel recording must match a class via a wildcard expression, so a non-empty class-pattern is mandatory.","triggerScenarios":"Running `tt -t` without `--class-pattern`, e.g. `tt -t --method-pattern prime` with the class missing.","commonSituations":"Forgetting the class-pattern; assuming -t takes positional args; passing an empty --class-pattern \"\".","solutions":["Add `--class-pattern <wildcard>` (e.g. the FQN or a wildcard like demo.MathGame).","Use `tt --help` to confirm the required options for record mode."],"exampleFix":"// before\ntt -t --method-pattern primeFactors\n// after\ntt -t --class-pattern demo.MathGame --method-pattern primeFactors","handlingStrategy":"validation","validationCode":"if (isTimeTunnel && (classPattern == null || classPattern.trim().isEmpty())) {\n    fail(\"-t requires --class-pattern\");\n}","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Always supply --class-pattern when using -t.","Use the FQN or a wildcard expression."],"tags":["arthas","tt-command","required-argument","pattern-matching"],"backgroundTag":null,"analyzedSha":"21cf2e9ba52b305290be7223b980ff504bb9cb5b","analyzedAt":"2026-08-14T00:57:07.243Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}