{"record":{"id":"ca81c04186898ee2","repo":"oracle/graal","slug":"annotation-value-type-is-not-an-annotation-inte","errorCode":null,"errorMessage":"Annotation value type {} is not an annotation interface","messagePattern":"Annotation value type (.+?) is not an annotation interface","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalHostProxies.java","lineNumber":645,"sourceCode":"        if (annotationValue.isError()) {\n            throw annotationValue.getError();\n        }\n        ResolvedJavaType actualAnnotationType = annotationValue.getAnnotationType();\n        validateAnnotationType(expectedAnnotationType, actualAnnotationType, \"guest return type\");\n        JavaConstant annotationConstant = Objects.requireNonNull(createGuestAnnotation(annotationValue));\n        if (!(annotationConstant instanceof EspressoExternalObjectConstant objectConstant)) {\n            throw new IllegalArgumentException(\"Expected guest annotation object, got \" + annotationConstant);\n        }\n        return objectConstant.getValue();\n    }\n\n    /**\n     * Verifies that an annotation value names an annotation interface assignable to the declared\n     * guest type.\n     */\n    private static void validateAnnotationType(ResolvedJavaType expectedAnnotationType, ResolvedJavaType actualAnnotationType, String expectedTypeDescription) {\n        if (!actualAnnotationType.isAnnotation()) {\n            throw new IllegalArgumentException(\"Annotation value type \" + actualAnnotationType.toJavaName() + \" is not an annotation interface\");\n        }\n        if (!expectedAnnotationType.isAssignableFrom(actualAnnotationType)) {\n            throw new IllegalArgumentException(\n                            \"Annotation value type \" + actualAnnotationType.toJavaName() + \" is not assignable to \" + expectedTypeDescription + \" \" + expectedAnnotationType.toJavaName());\n        }\n    }\n\n    /**\n     * Materializes a guest-owned JDK annotation proxy from JVMCI annotation metadata. Explicit\n     * elements are validated, defaults are supplied from the guest annotation type, absent required\n     * members remain absent, and malformed members are represented by deferred guest exception\n     * proxies.\n     */\n    private JavaConstant createGuestAnnotation(AnnotationValue annotationValue) {\n        ResolvedJavaType actualAnnotationType = annotationValue.getAnnotationType();\n        JavaConstant annotationClass = access.getProviders().getConstantReflection().asJavaClass(actualAnnotationType);\n        JavaConstant elements = access.invoke(access.java_util_HashMap_init, null);\n        Map<String, Object> annotationElements = annotationValue.getElements();","sourceCodeStart":627,"sourceCodeEnd":663,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalHostProxies.java#L627-L663","documentation":"Error \"Annotation value type {} is not an annotation interface\" thrown in oracle/graal.","triggerScenarios":"Thrown at espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalHostProxies.java:645 when the library encounters an invalid state.","commonSituations":"Occurs when a caller violates the contract guarded by this check: Annotation value type {} is not an annotation interface","solutions":["Fix the condition reported by the error: Annotation value type {} is not an annotation interface","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: Annotation value type {} is not an annotation interface","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"}