{"record":{"id":"2866cbfe8aa57e2f","repo":"oracle/graal","slug":"expected-an-espressoexternalresolvedjavamethod-go-2866cb","errorCode":null,"errorMessage":"Expected an EspressoExternalResolvedJavaMethod, got ","messagePattern":"Expected an EspressoExternalResolvedJavaMethod, got ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalVMAccess.java","lineNumber":728,"sourceCode":"             * this guest reflection object.\n             */\n            ResolvedJavaType declaringRecord = EspressoExternalConstantReflectionProvider.classAsType(value.invokeMember(\"getDeclaringRecord\"), this);\n            String name = value.invokeMember(\"getName\").asString();\n            ResolvedJavaType type = EspressoExternalConstantReflectionProvider.classAsType(value.invokeMember(\"getType\"), this);\n            for (ResolvedJavaRecordComponent component : declaringRecord.getRecordComponents()) {\n                if (component.getName().equals(name) && component.getType().equals(type)) {\n                    return component;\n                }\n            }\n            throw new JVMCIError(\"unresolved RecordComponent %s\", value);\n        }\n        return null;\n    }\n\n    @Override\n    public JavaConstant asFieldConstant(ResolvedJavaField field) {\n        if (!(field instanceof EspressoExternalResolvedJavaField espressoField)) {\n            throw new IllegalArgumentException(\"Expected an EspressoExternalResolvedJavaMethod, got \" + safeGetClass(field));\n        }\n        if (field.isInternal()) {\n            return null;\n        }\n        Value value = espressoField.getReflectFieldMirror();\n        if (value.isNull()) {\n            return null;\n        }\n        return new EspressoExternalObjectConstant(this, value);\n    }\n\n    @Override\n    public JavaConstant asExecutableConstant(ResolvedJavaMethod method) {\n        if (!(method instanceof EspressoExternalResolvedJavaMethod espressoMethod)) {\n            throw new IllegalArgumentException(\"Expected an EspressoExternalResolvedJavaMethod, got \" + safeGetClass(method));\n        }\n        if (espressoMethod.isClassInitializer()) {\n            return null;","sourceCodeStart":710,"sourceCodeEnd":746,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalVMAccess.java#L710-L746","documentation":"Error \"Expected an EspressoExternalResolvedJavaMethod, got \" thrown in oracle/graal.","triggerScenarios":"Thrown at espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalVMAccess.java:728 when the library encounters an invalid state.","commonSituations":"Occurs when a caller violates the contract guarded by this check: Expected an EspressoExternalResolvedJavaMethod, got","solutions":["Fix the condition reported by the error: Expected an EspressoExternalResolvedJavaMethod, got","Check the throwing call site and ensure its documented preconditions (argument values, types, environment, or configuration) are satisfied before the call."],"exampleFix":"Validate inputs and environment so that the failing condition does not occur: Expected an EspressoExternalResolvedJavaMethod, got","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}