{"record":{"id":"3c1928dff91941ce","repo":"pinpoint-apm/pinpoint","slug":"invalid-operator-not-found-right-operand-operat","errorCode":null,"errorMessage":"invalid operator - not found right operand. operator=${operator}","messagePattern":"invalid operator - not found right operand\\. operator=(.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/transformer/DefaultTransformerMatcher.java","lineNumber":253,"sourceCode":"        }\n\n        try {\n            return InternalClassMetadataReader.readInternalClassMetadata(classLoader, classInternalName);\n        } catch (Exception e) {\n            if (logger.isInfoEnabled()) {\n                logger.info(\"Failed to read metadata of class. classLoader={}, internalName={}\", classLoader, classInternalName, e);\n            }\n        }\n\n        // not found.\n        return null;\n    }\n\n    boolean traversal(ClassLoader classLoader, MatcherOperand operand, InternalClassMetadata classMetadata) {\n        if (operand instanceof NotMatcherOperator) {\n            NotMatcherOperator operator = (NotMatcherOperator) operand;\n            if (operator.getRightOperand() == null) {\n                throw new IllegalArgumentException(\"invalid operator - not found right operand. operator=\" + operator);\n            }\n\n            final MatcherOperand rightOperand = operator.getRightOperand();\n            // NOT\n            return match(classLoader, rightOperand, classMetadata) == false;\n        }\n\n        MatcherOperator operator = (MatcherOperator) operand;\n        // for binary operator.\n        if (operator.getLeftOperand() == null) {\n            throw new IllegalArgumentException(\"invalid operator - not found left operand. operator=\" + operator);\n        }\n        final MatcherOperand leftOperand = operator.getLeftOperand();\n\n        if (operator.getRightOperand() == null) {\n            throw new IllegalArgumentException(\"invalid operator - not found right operand. operator=\" + operator);\n        }\n        final MatcherOperand rightOperand = operator.getRightOperand();","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/transformer/DefaultTransformerMatcher.java#L235-L271","documentation":"When traversing a matcher operand expression tree, a NotMatcherOperator (logical NOT) must have a right operand. A NotMatcherOperator with a null right operand is structurally invalid, so traversal throws IllegalArgumentException before evaluating.","triggerScenarios":"Calling traversal()/match() with a NotMatcherOperator constructed without an operand, e.g. new NotMatcherOperator(null) or an operator whose right operand was never chained.","commonSituations":"Programmatic matcher expression building where a NOT operator is created but the operand to negate is never attached; deserialization or refactoring dropping the operand.","solutions":["Construct the NOT operator with a valid right operand (e.g. new NotMatcherOperator(someOperand) or chaining someOperand.not())","Add a null check before using the operator in your matcher construction code","Log/inspect how the MatcherOperand tree was built to find where the operand was lost"],"exampleFix":"// before\nMatcherOperand op = new NotMatcherOperator(null);\n// after\nMatcherOperand op = new NotMatcherOperator(new ClassInternalNameMatcherOperand(\"java/lang/String\"));","handlingStrategy":"validation","validationCode":"if (operand instanceof NotMatcherOperator && ((NotMatcherOperator) operand).getRightOperand() == null) throw new IllegalStateException(\"NOT operator missing operand\");","typeGuard":null,"tryCatchPattern":"try { boolean r = matcher.match(classLoader, operand, meta); } catch (IllegalArgumentException e) { log.error(\"malformed matcher tree: {}\", e.getMessage()); }","preventionTips":["Use fluent chaining (operand.not()) instead of raw constructors","Validate operand trees after building","Avoid passing null into operator constructors"],"tags":["java","matcher","operator-tree","null-operand","validation"],"backgroundTag":"invalid-argument-value","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}