{"record":{"id":"99a6bfaef00f47b6","repo":"oracle/graal","slug":"unexpected-enum-type-s-99a6bf","errorCode":null,"errorMessage":"Unexpected enum type: %s","messagePattern":"Unexpected enum type: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler.vmaccess/src/jdk/graal/compiler/vmaccess/HostAnnotationValueConverter.java","lineNumber":171,"sourceCode":"            }\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\n     * {@code AnnotationTypeMismatchExceptionProxy}. The JDK annotation invocation handler calls\n     * {@link #generateException()} only when the affected member is accessed.\n     */","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler.vmaccess/src/jdk/graal/compiler/vmaccess/HostAnnotationValueConverter.java#L153-L189","documentation":"Error \"Unexpected enum type: %s\" thrown in oracle/graal.","triggerScenarios":"Thrown at compiler/src/jdk.graal.compiler.vmaccess/src/jdk/graal/compiler/vmaccess/HostAnnotationValueConverter.java:171 when the library encounters an invalid state.","commonSituations":"Occurs when a caller violates the contract guarded by this check: Unexpected enum type: {}","solutions":["Fix the condition reported by the error: Unexpected enum type: {}","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: Unexpected enum type: {}","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-15T17:31:12.345Z"}