{"record":{"id":"b9e0334825d6b63e","repo":"oracle/graal","slug":"annotation-enum-element-type-s-has-no-host-class","errorCode":null,"errorMessage":"Annotation enum element type %s has no host class","messagePattern":"Annotation enum element type (.+?) has no host class","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler.vmaccess/src/jdk/graal/compiler/vmaccess/HostAnnotationValueConverter.java","lineNumber":168,"sourceCode":"                    return element;\n                }\n                Array.set(array, i, element);\n            }\n            return array;\n        }\n        if (targetType == Class.class) {\n            ResolvedJavaType classType = (ResolvedJavaType) value;\n            Class<?> clazz = typeToClass.apply(classType);\n            if (clazz == null) {\n                throw new IllegalArgumentException(\"Annotation class element type \" + classType.toJavaName() + \" has no host class\");\n            }\n            return clazz;\n        }\n        if (targetType.isEnum()) {\n            EnumElement enumElement = (EnumElement) value;\n            Class<?> enumType = typeToClass.apply(enumElement.enumType);\n            if (enumType == null) {\n                throw new IllegalArgumentException(\"Annotation enum element type \" + enumElement.enumType.toJavaName() + \" has no host class\");\n            }\n            if (enumType != targetType) {\n                throw new IllegalArgumentException(\"Unexpected enum type: \" + enumType.getName());\n            }\n            try {\n                return Enum.valueOf((Class<? extends Enum>) enumType.asSubclass(Enum.class), enumElement.name);\n            } catch (IllegalArgumentException e) {\n                return new EnumConstantNotPresentExceptionProxy((Class<? extends Enum<?>>) enumType, enumElement.name);\n            }\n        }\n        if (targetType.isAnnotation()) {\n            return toAnnotation((AnnotationValue) value, targetType.asSubclass(Annotation.class), typeToClass);\n        }\n        return value;\n    }\n\n    /**\n     * Accessible replacement for the JDK's package-private","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler.vmaccess/src/jdk/graal/compiler/vmaccess/HostAnnotationValueConverter.java#L150-L186","documentation":"Error \"Annotation enum element type %s has no host class\" thrown in oracle/graal.","triggerScenarios":"Thrown at compiler/src/jdk.graal.compiler.vmaccess/src/jdk/graal/compiler/vmaccess/HostAnnotationValueConverter.java:168 when the library encounters an invalid state.","commonSituations":"Occurs when a caller violates the contract guarded by this check: Annotation enum element type {} has no host class","solutions":["Fix the condition reported by the error: Annotation enum element type {} has no host class","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 enum element type {} has no host class","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"}