{"record":{"id":"54de8d94fa3b02a5","repo":"oracle/graal","slug":"not-implemented","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/graph/NodeList.java","lineNumber":395,"sourceCode":"\n    @Override\n    public int indexOf(Object node) {\n        for (int i = 0; i < size; i++) {\n            if (nodes[i] == node) {\n                return i;\n            }\n        }\n        return -1;\n    }\n\n    @Override\n    public boolean contains(Object o) {\n        return indexOf(o) != -1;\n    }\n\n    @Override\n    public boolean containsAll(Collection<?> c) {\n        throw new UnsupportedOperationException(\"not implemented\");\n    }\n\n    @Override\n    public boolean addAll(Collection<? extends T> c) {\n        for (T e : c) {\n            add(e);\n        }\n        return true;\n    }\n\n    @Override\n    public String toString() {\n        StringBuilder sb = new StringBuilder();\n        sb.append('[');\n        for (int i = 0; i < size; i++) {\n            if (i != 0) {\n                sb.append(\", \");\n            }","sourceCodeStart":377,"sourceCodeEnd":413,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/graph/NodeList.java#L377-L413","documentation":"NodeList implements Collection<T> for API compatibility but deliberately leaves containsAll unimplemented because there is no efficient use for it on node input lists. Calling it throws UnsupportedOperationException('not implemented'), signalling an unsupported operation rather than a runtime fault. Other Collection methods like contains(Object) and addAll are implemented and should be used instead.","triggerScenarios":"Calling nodeList.containsAll(other) directly, or passing a NodeList into generic Collection machinery (e.g. Collection.retainAll, removeAll, or library code like Guava's Iterables/sets utilities) that invokes containsAll internally.","commonSituations":"Treating node.inputList() / usages as a plain Collection in helper code. Utilities such as Collections.checkedCollection, Set operations, or test assertions (assertEquals on collections) that probe with containsAll. Copying node lists into generic algorithms.","solutions":["Replace containsAll with an explicit loop over the other collection using contains(Object) or indexOf(o).","Copy the NodeList into an ArrayList before passing it to generic Collection APIs.","For set-like semantics, build a HashSet<Node> from the list and use standard set operations."],"exampleFix":"// before\nboolean hasAll = node.inputs().containsAll(required); // UnsupportedOperationException\n\n// after\nboolean hasAll = true;\nfor (Node r : required) {\n    if (!node.inputs().contains(r)) { hasAll = false; break; }\n}","handlingStrategy":"validation","validationCode":"static <T> boolean containsAll(NodeList<T> list, Collection<?> c) {\n    for (Object o : c) {\n        if (!list.contains(o)) return false;\n    }\n    return true;\n}","typeGuard":"static boolean isFullyImplementedCollection(Collection<?> c) {\n    try {\n        c.containsAll(java.util.List.of()); // cheap probe: empty containsAll still throws if unimplemented\n        return true;\n    } catch (UnsupportedOperationException e) {\n        return false;\n    }\n}","tryCatchPattern":null,"preventionTips":["Do not hand NodeList into generic Collection utilities; copy to ArrayList first.","Wrap node lists in your own adapter that implements the operations you actually use."],"tags":["java","graal","graal-compiler","unsupported-operation","collection","api-misuse"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}