{"record":{"id":"be8a5e795564c238","repo":"apache/maven","slug":"more-than-one-scope-annotation-on","errorCode":null,"errorMessage":"More than one scope annotation on {}","messagePattern":"More than one scope annotation on (.+?)","errorType":"exception","errorClass":"DIException","httpStatus":null,"severity":"error","filePath":"impl/maven-di/src/main/java/org/apache/maven/di/impl/ReflectionUtils.java","lineNumber":105,"sourceCode":"                    throw new DIException(\"More than one qualifier annotation on \" + annotatedElement);\n                }\n                if (annotation instanceof Named named) {\n                    qualifier = named.value();\n                } else {\n                    Class<? extends Annotation> annotationType = annotation.annotationType();\n                    qualifier = annotationType.getDeclaredMethods().length == 0 ? annotationType : annotation;\n                }\n            }\n        }\n        return qualifier;\n    }\n\n    public static @Nullable Annotation scopeOf(AnnotatedElement annotatedElement) {\n        Annotation scope = null;\n        for (Annotation annotation : annotatedElement.getDeclaredAnnotations()) {\n            if (annotation.annotationType().isAnnotationPresent(org.apache.maven.api.di.Scope.class)) {\n                if (scope != null) {\n                    throw new DIException(\"More than one scope annotation on \" + annotatedElement);\n                }\n                scope = annotation;\n            }\n        }\n        return scope;\n    }\n\n    public static <T> Key<T> keyOf(@Nullable Type container, Type type, AnnotatedElement annotatedElement) {\n        return Key.ofType(\n                container != null ? Types.bind(type, Types.getAllTypeBindings(container)) : type,\n                qualifierOf(annotatedElement));\n    }\n\n    public static <T extends AnnotatedElement & Member> List<T> getAnnotatedElements(\n            Class<?> cls,\n            Class<? extends Annotation> annotationType,\n            Function<Class<?>, T[]> extractor,\n            boolean allowStatic) {","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-di/src/main/java/org/apache/maven/di/impl/ReflectionUtils.java#L87-L123","documentation":"Error \"More than one scope annotation on {}\" thrown in apache/maven.","triggerScenarios":"Thrown at impl/maven-di/src/main/java/org/apache/maven/di/impl/ReflectionUtils.java:105 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}