pinpoint-apm/pinpoint · error · IllegalArgumentException

invalid operator - not found right operand. operator=

Error message

invalid operator - not found right operand. operator=${operator}

What it means

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.

Solutions

  1. Construct the NOT operator with a valid right operand (e.g. new NotMatcherOperator(someOperand) or chaining someOperand.not())
  2. Add a null check before using the operator in your matcher construction code
  3. Log/inspect how the MatcherOperand tree was built to find where the operand was lost

Example fix

// before
MatcherOperand op = new NotMatcherOperator(null);
// after
MatcherOperand op = new NotMatcherOperator(new ClassInternalNameMatcherOperand("java/lang/String"));
Defensive patterns

Strategy: validation

Validate before calling

if (operand instanceof NotMatcherOperator && ((NotMatcherOperator) operand).getRightOperand() == null) throw new IllegalStateException("NOT operator missing operand");

Try / catch

try { boolean r = matcher.match(classLoader, operand, meta); } catch (IllegalArgumentException e) { log.error("malformed matcher tree: {}", e.getMessage()); }

Prevention

When it happens

Trigger: Calling traversal()/match() with a NotMatcherOperator constructed without an operand, e.g. new NotMatcherOperator(null) or an operator whose right operand was never chained.

Common situations: Programmatic matcher expression building where a NOT operator is created but the operand to negate is never attached; deserialization or refactoring dropping the operand.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07). Data as JSON: /api/errors/3c1928dff91941ce. Report an issue: GitHub.

Appendix: source

Thrown at agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/transformer/DefaultTransformerMatcher.java:253

        }

        try {
            return InternalClassMetadataReader.readInternalClassMetadata(classLoader, classInternalName);
        } catch (Exception e) {
            if (logger.isInfoEnabled()) {
                logger.info("Failed to read metadata of class. classLoader={}, internalName={}", classLoader, classInternalName, e);
            }
        }

        // not found.
        return null;
    }

    boolean traversal(ClassLoader classLoader, MatcherOperand operand, InternalClassMetadata classMetadata) {
        if (operand instanceof NotMatcherOperator) {
            NotMatcherOperator operator = (NotMatcherOperator) operand;
            if (operator.getRightOperand() == null) {
                throw new IllegalArgumentException("invalid operator - not found right operand. operator=" + operator);
            }

            final MatcherOperand rightOperand = operator.getRightOperand();
            // NOT
            return match(classLoader, rightOperand, classMetadata) == false;
        }

        MatcherOperator operator = (MatcherOperator) operand;
        // for binary operator.
        if (operator.getLeftOperand() == null) {
            throw new IllegalArgumentException("invalid operator - not found left operand. operator=" + operator);
        }
        final MatcherOperand leftOperand = operator.getLeftOperand();

        if (operator.getRightOperand() == null) {
            throw new IllegalArgumentException("invalid operator - not found right operand. operator=" + operator);
        }
        final MatcherOperand rightOperand = operator.getRightOperand();

View on GitHub (pinned to 744c3d3075)