{"record":{"id":"e3ba8458b8051702","repo":"pinpoint-apm/pinpoint","slug":"bracketmatcheroperator-is-not-an-operation-target","errorCode":null,"errorMessage":"BracketMatcherOperator is not an operation target.","messagePattern":"BracketMatcherOperator is not an operation target\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"agent-module/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/instrument/matcher/operator/BracketMatcherOperator.java","lineNumber":60,"sourceCode":"\n    @Override\n    public boolean isIndex() {\n        return false;\n    }\n\n    @Override\n    public MatcherOperand getLeftOperand() {\n        return null;\n    }\n\n    @Override\n    public MatcherOperand getRightOperand() {\n        return null;\n    }\n\n    @Override\n    public MatcherOperand and(MatcherOperand operand) {\n        throw new UnsupportedOperationException(\"BracketMatcherOperator is not an operation target.\");\n    }\n\n    @Override\n    public MatcherOperand or(MatcherOperand operand) {\n        throw new UnsupportedOperationException(\"BracketMatcherOperator is not an operation target.\");\n    }\n\n    @Override\n    public MatcherOperand not() {\n        throw new UnsupportedOperationException(\"BracketMatcherOperator is not an operation target.\");\n    }\n\n    public String toString() {\n        return \"(\";\n    }\n}","sourceCodeStart":42,"sourceCodeEnd":76,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/instrument/matcher/operator/BracketMatcherOperator.java#L42-L76","documentation":"BracketMatcherOperator represents the '(' parenthesis token in the matcher operand expression tree. It is purely a structural marker used by the operand parser, not a real operand, so its and()/or()/not() composition methods intentionally throw UnsupportedOperationException to signal that you cannot combine it as an operand.","triggerScenarios":"Calling and(), or(), or not() directly on a BracketMatcherOperator instance obtained from Matchers.Operators (e.g. via andChain()/orChain() parentheses tokens) instead of on a real MatcherOperand.","commonSituations":"Building a custom matcher expression by hand and misusing the bracket token from an operator chain; calling composition methods on the wrong object returned by an operand builder API.","solutions":["Do not call and/or/not on BracketMatcherOperator; call them on the MatcherOperand that the bracket encloses or wraps","Use Matchers.Operators.andChain()/orChain() correctly: brackets only delimit grouping, the methods belong to operand classes","Review the operand tree construction so and/or are invoked on leaf operands (ClassInternalNameMatcher etc.)"],"exampleFix":"// before\nMatcherOperand op = Operators.andChain();\nop.and(new ClassInternalNameMatcher(\"Foo\")); // throws\n// after\nMatcherOperand op = new ClassInternalNameMatcher(\"Foo\").and(new ArgsMatcher(2));","handlingStrategy":"validation","validationCode":"if (operand instanceof BracketMatcherOperator) {\n    throw new IllegalArgumentException(\"bracket token is not combinable; use a real MatcherOperand\");\n}","typeGuard":"boolean isRealOperand(MatcherOperand o) { return o != null && !(o instanceof BracketMatcherOperator); }","tryCatchPattern":null,"preventionTips":["Treat bracket tokens as syntax markers only, never as operands","Use andChain()/orChain() APIs for grouping instead of manual brackets","Add instanceof checks when traversing operand trees programmatically"],"tags":["unsupported-operation","matcher","instrumentation"],"backgroundTag":"unsupported-operation","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}