{"record":{"id":"c49d63e300e7ba5a","repo":"oracle/graal","slug":"resolution-of-s-constant-pool-entries-not-support","errorCode":null,"errorMessage":"Resolution of %s constant pool entries not supported by %s","messagePattern":"Resolution of (.+?) constant pool entries not supported by (.+?)","errorType":"exception","errorClass":"GraalError","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/replacements/classfile/ClassfileConstant.java","lineNumber":277,"sourceCode":"        final String value;\n\n        Utf8(String value) {\n            super(CONSTANT_Utf8);\n            this.value = value;\n        }\n    }\n\n    static class Unsupported extends ClassfileConstant {\n        final String name;\n\n        Unsupported(byte tag, String name) {\n            super(tag);\n            this.name = name;\n        }\n\n        @Override\n        public void loadReferencedType(ClassfileConstantPool cp, int index, int opcode) {\n            throw new GraalError(\"Resolution of \" + name + \" constant pool entries not supported by \" + ClassfileBytecodeProvider.class.getSimpleName());\n        }\n    }\n\n    static ResolvedJavaMethod resolveMethod(ClassfileBytecodeProvider context, ResolvedJavaType c, String name, String descriptor, boolean isStatic) {\n        ResolvedJavaMethod method = context.findMethod(c, name, descriptor, isStatic);\n        if (method != null) {\n            return method;\n        }\n        if (!c.isJavaLangObject() && !c.isInterface()) {\n            method = resolveMethod(context, c.getSuperclass(), name, descriptor, isStatic);\n            if (method != null) {\n                return method;\n            }\n        }\n        for (ResolvedJavaType i : c.getInterfaces()) {\n            method = resolveMethod(context, i, name, descriptor, isStatic);\n            if (method != null) {\n                return method;","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/replacements/classfile/ClassfileConstant.java#L259-L295","documentation":"The constant-pool parser tolerates MethodHandle, MethodType, Dynamic, and InvokeDynamic entries by skipping their bytes and recording a ClassfileConstant.Unsupported placeholder. If anything later actually needs to load the referenced type of such an entry, loadReferencedType throws GraalError naming the entry kind and ClassfileBytecodeProvider.","triggerScenarios":"A class parsed by ClassfileBytecodeProvider contains method-handle/method-type/condy/indy entries AND the graph builder forces eager loading of the types those entries reference (the usual trigger is lambda or method-reference code inside snippet classes).","commonSituations":"Same family as the INVOKEDYNAMIC errors: functional-interface sugar, indy string concat, or MethodHandle use inside replacements/snippets re-parsed from class files.","solutions":["Eliminate the construct that created the entry (lambda -> anonymous class, method reference -> direct call, '+' concat -> StringBuilder).","Verify the cleaned class with javap -c: no invokedynamic/CONSTANT_MethodHandle entries should remain in snippet classes."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid MethodHandle/MethodType/condy usage in any class processed by ClassfileBytecodeProvider.","Treat this error and the INVOKEDYNAMIC ones as one root cause: rewrite the snippet without indy constructs."],"tags":["graal","constant-pool","method-handle","snippet","invokedynamic"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}