{"record":{"id":"96fb59e8325b417f","repo":"alibaba/arthas","slug":"method-pattern-is-expected-please-type-the-wildca","errorCode":null,"errorMessage":"Method-pattern is expected, please type the wildcard expression to match","messagePattern":"Method-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":264,"sourceCode":"     */\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();\n        timeFragmentMap.put(indexOfSeq, tt);\n        return indexOfSeq;\n    }","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/alibaba/arthas/blob/21cf2e9ba52b305290be7223b980ff504bb9cb5b/core/src/main/java/com/taobao/arthas/core/command/monitor200/TimeTunnelCommand.java#L246-L282","documentation":"Thrown by checkArguments() in the `tt` command when record mode (-t) is active with a class-pattern present but the method-pattern is empty. Recording requires both a class and a method wildcard.","triggerScenarios":"Running `tt -t --class-pattern demo.MathGame` with no `--method-pattern`, or `tt -t --class-pattern demo.MathGame --method-pattern \"\"`.","commonSituations":"Forgetting the method-pattern; intending to match all methods (use `--method-pattern *` rather than empty).","solutions":["Add `--method-pattern <wildcard>`, e.g. `--method-pattern primeFactors` or `--method-pattern *` to match all methods.","Confirm both class and method patterns are non-empty when using -t."],"exampleFix":"// before\ntt -t --class-pattern demo.MathGame\n// after\ntt -t --class-pattern demo.MathGame --method-pattern *","handlingStrategy":"validation","validationCode":"if (isTimeTunnel && (methodPattern == null || methodPattern.trim().isEmpty())) {\n    fail(\"-t requires --method-pattern\");\n}","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Always supply --method-pattern when using -t.","Use `*` to match all methods rather than leaving it empty."],"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"}