{"record":{"id":"7ef6c593aa342af0","repo":"pinpoint-apm/pinpoint","slug":"index-out-of-range","errorCode":null,"errorMessage":"index out of range:","messagePattern":"index out of range:","errorType":"exception","errorClass":"NoSuchElementException","httpStatus":null,"severity":"error","filePath":"agent-module/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/classloader/MergedEnumeration2.java","lineNumber":61,"sourceCode":"\n            nextIndex();\n        }\n\n        return false;\n    }\n\n    private void nextIndex() {\n        this.index++;\n    }\n\n    private Enumeration<E> getEnumeration() {\n        switch (index) {\n            case 0:\n                return enum0;\n            case 1:\n                return enum1;\n            default:\n                throw new NoSuchElementException(\"index out of range:\" + index);\n        }\n    }\n\n    public boolean hasMoreElements() {\n        return this.next();\n    }\n\n    public E nextElement() {\n        if (!this.next()) {\n            throw new NoSuchElementException();\n        }\n\n        Enumeration<E> enumeration = getEnumeration();\n        return enumeration.nextElement();\n    }\n\n}\n","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/classloader/MergedEnumeration2.java#L43-L79","documentation":"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.","triggerScenarios":"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.","commonSituations":"See trigger scenarios.","solutions":["Check that next() stops advancing once both enumerations are exhausted","Reset or bound the index so it never exceeds 1","Review custom iteration logic that calls nextElement/next beyond hasMoreElements == false"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}