pinpoint-apm/pinpoint · error · IllegalArgumentException

basePackageNames must not be empty

Error message

basePackageNames must not be empty 

What it means

Guard in DefaultMultiPackageBasedMatcher.joinOr: called with a null or empty basePackageNames list, which cannot be OR-joined into a package operand. Fires when the package list is empty at the point of operand construction.

Solutions

  1. Pass a non-empty list of package names to joinOr/matcher construction
  2. Validate collections before building package-based matchers
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at agent-module/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/instrument/matcher/DefaultMultiPackageBasedMatcher.java:66 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at agent-module/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/instrument/matcher/DefaultMultiPackageBasedMatcher.java:66

            throw new IllegalStateException("operand is null");
        }
        this.matcherOperand = addOr(operand, additional);

        this.basePackageNames = Collections.unmodifiableList(buildBasePackageName);
    }

    private MatcherOperand addOr(MatcherOperand operand, MatcherOperand additional) {
        if (additional == null) {
            return operand;
        }
        // (package OR ...) AND additional
        operand = operand.and(additional);
        return operand;
    }

    private MatcherOperand joinOr(List<String> basePackageNames) {
        if (basePackageNames.isEmpty()) {
            throw new IllegalArgumentException("basePackageNames must not be empty ");
        }

        MatcherOperand operandGroup = null;
        for (String basePackageName : basePackageNames) {
            if (operandGroup == null) {
                operandGroup = new PackageInternalNameMatcherOperand(basePackageName);
            } else {
                // package OR ...
                final MatcherOperand packageMatcherOperand = new PackageInternalNameMatcherOperand(basePackageName);
                operandGroup = operandGroup.or(packageMatcherOperand);
            }
        }
        return operandGroup;
    }

    private List<String> buildBasePackageNameList(List<String> basePackageNames) {
        final List<String> list = new ArrayList<>(basePackageNames.size());
        for (String basePackageName : basePackageNames) {

View on GitHub (pinned to 744c3d3075)