pinpoint-apm/pinpoint · error · NoSuchElementException

index out of range:

Error message

index out of range:

What it means

Guard in MergedEnumeration2.getEnumeration: the internal index stepping over the two merged enumerations escaped the valid range 0-1 (only enum0 and enum1 exist). It fires when next() advances past the last enumeration, i.e. an iteration state bug or unexpected extra call rather than bad user input.

Solutions

  1. Check that next() stops advancing once both enumerations are exhausted
  2. Reset or bound the index so it never exceeds 1
  3. Review custom iteration logic that calls nextElement/next beyond hasMoreElements == false
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at agent-module/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/classloader/MergedEnumeration2.java:61 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/7ef6c593aa342af0. Report an issue: GitHub.

Appendix: source

Thrown at agent-module/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/classloader/MergedEnumeration2.java:61

            nextIndex();
        }

        return false;
    }

    private void nextIndex() {
        this.index++;
    }

    private Enumeration<E> getEnumeration() {
        switch (index) {
            case 0:
                return enum0;
            case 1:
                return enum1;
            default:
                throw new NoSuchElementException("index out of range:" + index);
        }
    }

    public boolean hasMoreElements() {
        return this.next();
    }

    public E nextElement() {
        if (!this.next()) {
            throw new NoSuchElementException();
        }

        Enumeration<E> enumeration = getEnumeration();
        return enumeration.nextElement();
    }

}

View on GitHub (pinned to 744c3d3075)