diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/ClassComparisonUtil.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/ClassComparisonUtil.java index ff51f50bea7d0..a7f18fb788e72 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/dev/ClassComparisonUtil.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/ClassComparisonUtil.java @@ -29,7 +29,7 @@ static boolean isSameStructure(ClassInfo clazz, ClassInfo old) { if (!clazz.interfaceNames().equals(old.interfaceNames())) { return false; } - if (!compareAnnotations(clazz.classAnnotations(), old.classAnnotations())) { + if (!compareAnnotations(clazz.declaredAnnotations(), old.declaredAnnotations())) { return false; } if (old.fields().size() != clazz.fields().size()) { diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/testing/JunitTestRunner.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/testing/JunitTestRunner.java index 3391d59f0494d..c237568887185 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/dev/testing/JunitTestRunner.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/testing/JunitTestRunner.java @@ -581,7 +581,7 @@ private DiscoveryResult discoverTestClasses() { if (instance.target().kind() == AnnotationTarget.Kind.METHOD) { ClassInfo classInfo = instance.target().asMethod().declaringClass(); allTestClasses.add(classInfo.name()); - if (classInfo.classAnnotation(NESTED) != null) { + if (classInfo.declaredAnnotation(NESTED) != null) { var enclosing = classInfo.enclosingClass(); if (enclosing != null) { enclosingClasses.put(classInfo.name(), enclosing); @@ -590,7 +590,7 @@ private DiscoveryResult discoverTestClasses() { } else if (instance.target().kind() == AnnotationTarget.Kind.FIELD) { ClassInfo classInfo = instance.target().asField().declaringClass(); allTestClasses.add(classInfo.name()); - if (classInfo.classAnnotation(NESTED) != null) { + if (classInfo.declaredAnnotation(NESTED) != null) { var enclosing = classInfo.enclosingClass(); if (enclosing != null) { enclosingClasses.put(classInfo.name(), enclosing); @@ -639,7 +639,7 @@ private DiscoveryResult discoverTestClasses() { @Override public String apply(Class aClass) { ClassInfo def = index.getClassByName(DotName.createSimple(aClass.getName())); - AnnotationInstance testProfile = def.classAnnotation(TEST_PROFILE); + AnnotationInstance testProfile = def.declaredAnnotation(TEST_PROFILE); if (testProfile == null) { return "$$" + aClass.getName(); } diff --git a/extensions/amazon-lambda/deployment/src/main/java/io/quarkus/amazon/lambda/deployment/AmazonLambdaProcessor.java b/extensions/amazon-lambda/deployment/src/main/java/io/quarkus/amazon/lambda/deployment/AmazonLambdaProcessor.java index 09085bcd335cf..7463692b17d42 100644 --- a/extensions/amazon-lambda/deployment/src/main/java/io/quarkus/amazon/lambda/deployment/AmazonLambdaProcessor.java +++ b/extensions/amazon-lambda/deployment/src/main/java/io/quarkus/amazon/lambda/deployment/AmazonLambdaProcessor.java @@ -103,7 +103,7 @@ List discover(CombinedIndexBuildItem combinedIndexBuildIt .produce(ReflectiveClassBuildItem.builder(lambda).methods().build()); String cdiName = null; - AnnotationInstance named = info.classAnnotation(NAMED); + AnnotationInstance named = info.declaredAnnotation(NAMED); if (named != null) { cdiName = named.value().asString(); } diff --git a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/CustomScopeAnnotationsBuildItem.java b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/CustomScopeAnnotationsBuildItem.java index 4c138604980ca..07f7ddd0bba70 100644 --- a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/CustomScopeAnnotationsBuildItem.java +++ b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/CustomScopeAnnotationsBuildItem.java @@ -43,7 +43,7 @@ public Collection getCustomScopeNames() { */ public boolean isCustomScopeDeclaredOn(ClassInfo clazz) { for (DotName scope : customScopeNames) { - if (clazz.classAnnotation(scope) != null) { + if (clazz.declaredAnnotation(scope) != null) { return true; } } diff --git a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/LookupConditionsProcessor.java b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/LookupConditionsProcessor.java index d2f66dccebc8c..8c9ea6f1ba07f 100644 --- a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/LookupConditionsProcessor.java +++ b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/LookupConditionsProcessor.java @@ -103,8 +103,8 @@ List findAnnotations(AnnotationTarget target, DotName annota AnnotationInstance container; switch (target.kind()) { case CLASS: - annotation = target.asClass().classAnnotation(annotationName); - container = target.asClass().classAnnotation(containingAnnotationName); + annotation = target.asClass().declaredAnnotation(annotationName); + container = target.asClass().declaredAnnotation(containingAnnotationName); break; case FIELD: annotation = target.asField().annotation(annotationName); diff --git a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/ReflectiveBeanClassesProcessor.java b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/ReflectiveBeanClassesProcessor.java index 9af9059e1cec4..358fb65da66cf 100644 --- a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/ReflectiveBeanClassesProcessor.java +++ b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/ReflectiveBeanClassesProcessor.java @@ -19,7 +19,7 @@ void implicitReflectiveBeanClasses(BuildProducer r for (BeanInfo classBean : beanDiscoveryFinished.beanStream().classBeans()) { ClassInfo beanClass = classBean.getTarget().get().asClass(); - AnnotationInstance annotation = beanClass.classAnnotation(registerForReflection); + AnnotationInstance annotation = beanClass.declaredAnnotation(registerForReflection); if (annotation != null) { Type[] targets = annotation.value("targets") != null ? annotation.value("targets").asClassArray() : new Type[] {}; diff --git a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/UnremovableBeanBuildItem.java b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/UnremovableBeanBuildItem.java index 098b5115a60e2..5984271398bf1 100644 --- a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/UnremovableBeanBuildItem.java +++ b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/UnremovableBeanBuildItem.java @@ -172,7 +172,7 @@ public static UnremovableBeanBuildItem targetWithAnnotation(DotName annotationNa @Override public boolean test(BeanInfo bean) { if (bean.isClassBean()) { - return Annotations.contains(bean.getTarget().get().asClass().classAnnotations(), annotationName); + return Annotations.contains(bean.getTarget().get().asClass().declaredAnnotations(), annotationName); } else if (bean.isProducerMethod()) { return !getAnnotations(Kind.METHOD, annotationName, bean.getTarget().get().asMethod().annotations()) .isEmpty(); diff --git a/extensions/cache/deployment/src/main/java/io/quarkus/cache/deployment/CacheProcessor.java b/extensions/cache/deployment/src/main/java/io/quarkus/cache/deployment/CacheProcessor.java index 020f15d8b5130..53502e4976002 100644 --- a/extensions/cache/deployment/src/main/java/io/quarkus/cache/deployment/CacheProcessor.java +++ b/extensions/cache/deployment/src/main/java/io/quarkus/cache/deployment/CacheProcessor.java @@ -140,7 +140,7 @@ void validateCacheAnnotationsAndProduceCacheNames(CombinedIndexBuildItem combine */ if (container.target().kind() == METHOD) { MethodInfo methodInfo = container.target().asMethod(); - if (methodInfo.declaringClass().classAnnotation(REGISTER_REST_CLIENT) != null) { + if (methodInfo.declaringClass().declaredAnnotation(REGISTER_REST_CLIENT) != null) { throwables.add(new UnsupportedRepeatedAnnotationException(methodInfo)); } } diff --git a/extensions/funqy/funqy-server-common/deployment/src/main/java/io/quarkus/funqy/deployment/FunctionScannerBuildStep.java b/extensions/funqy/funqy-server-common/deployment/src/main/java/io/quarkus/funqy/deployment/FunctionScannerBuildStep.java index 7d01b12a7e060..344c3de220edd 100644 --- a/extensions/funqy/funqy-server-common/deployment/src/main/java/io/quarkus/funqy/deployment/FunctionScannerBuildStep.java +++ b/extensions/funqy/funqy-server-common/deployment/src/main/java/io/quarkus/funqy/deployment/FunctionScannerBuildStep.java @@ -137,7 +137,7 @@ public void transform(TransformationContext transformationContext) { } Transformation transformation = transformationContext.transform(); transformation.add(BuiltinScope.DEPENDENT.getName()); - if (clazz.classAnnotation(DotNames.TYPED) == null) { + if (clazz.declaredAnnotation(DotNames.TYPED) == null) { // Add @Typed(MySubresource.class) transformation.add(createTypedAnnotationInstance(clazz)); } diff --git a/extensions/grpc/deployment/src/main/java/io/quarkus/grpc/deployment/GrpcInterceptors.java b/extensions/grpc/deployment/src/main/java/io/quarkus/grpc/deployment/GrpcInterceptors.java index 0722cf9d44598..8b436cae4e1ca 100644 --- a/extensions/grpc/deployment/src/main/java/io/quarkus/grpc/deployment/GrpcInterceptors.java +++ b/extensions/grpc/deployment/src/main/java/io/quarkus/grpc/deployment/GrpcInterceptors.java @@ -36,7 +36,7 @@ static GrpcInterceptors gatherInterceptors(IndexView index, DotName interceptorI || Modifier.isInterface(interceptorImplClass.flags())) { continue; } - if (interceptorImplClass.classAnnotation(GLOBAL_INTERCEPTOR) == null) { + if (interceptorImplClass.declaredAnnotation(GLOBAL_INTERCEPTOR) == null) { nonGlobalInterceptors.add(interceptorImplClass.name().toString()); } else { globalInterceptors.add(interceptorImplClass.name().toString()); diff --git a/extensions/grpc/deployment/src/main/java/io/quarkus/grpc/deployment/GrpcServerProcessor.java b/extensions/grpc/deployment/src/main/java/io/quarkus/grpc/deployment/GrpcServerProcessor.java index ff3792f1e293e..e216ad7fa2bf9 100644 --- a/extensions/grpc/deployment/src/main/java/io/quarkus/grpc/deployment/GrpcServerProcessor.java +++ b/extensions/grpc/deployment/src/main/java/io/quarkus/grpc/deployment/GrpcServerProcessor.java @@ -134,7 +134,7 @@ void processGeneratedBeans(CombinedIndexBuildItem index, BuildProducer classes, String methodNa BlockingMode methodMode = BlockingMode.UNDEFINED; for (int i = 0; i < classes.size(); i++) { ClassInfo ci = classes.get(i); - Predicate annotationOnClass = annotationName -> ci.classAnnotation(annotationName) != null; + Predicate annotationOnClass = annotationName -> ci.declaredAnnotation(annotationName) != null; MethodInfo method = ci.method(methodName, methodArgs); classModeInherited = inheritedBlockingMode(annotationOnClass, classModeInherited); @@ -334,7 +334,7 @@ private static boolean methodIsBlocking(List classes, String methodNa if (methodMode == BlockingMode.UNDEFINED) { for (i++; i < classes.size(); i++) { ClassInfo ci2 = classes.get(i); - annotationOnClass = annotationName -> ci2.classAnnotation(annotationName) != null; + annotationOnClass = annotationName -> ci2.declaredAnnotation(annotationName) != null; classModeInherited = inheritedBlockingMode(annotationOnClass, classModeInherited); } } diff --git a/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmProcessor.java b/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmProcessor.java index a591aa91d221f..2c994a2cf0f53 100644 --- a/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmProcessor.java +++ b/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmProcessor.java @@ -1329,8 +1329,8 @@ public static Map> getModelClassesAndPackagesPerPersistenceU Set relatedModelClassNames = getRelatedModelClassNames(index, jpaModel.getAllModelClassNames(), modelClassInfo); - if (modelClassInfo != null && (modelClassInfo.classAnnotation(ClassNames.QUARKUS_PERSISTENCE_UNIT) != null - || modelClassInfo.classAnnotation(ClassNames.QUARKUS_PERSISTENCE_UNIT_REPEATABLE_CONTAINER) != null)) { + if (modelClassInfo != null && (modelClassInfo.declaredAnnotation(ClassNames.QUARKUS_PERSISTENCE_UNIT) != null + || modelClassInfo.declaredAnnotation(ClassNames.QUARKUS_PERSISTENCE_UNIT_REPEATABLE_CONTAINER) != null)) { modelClassesWithPersistenceUnitAnnotations.add(modelClassInfo.name().toString()); } @@ -1390,8 +1390,8 @@ private static Set getRelatedModelClassNames(IndexView index, Set relatedModelClassNames = new HashSet<>(); // for now we only deal with entities and mapped super classes - if (modelClassInfo.classAnnotation(ClassNames.JPA_ENTITY) == null && - modelClassInfo.classAnnotation(ClassNames.MAPPED_SUPERCLASS) == null) { + if (modelClassInfo.declaredAnnotation(ClassNames.JPA_ENTITY) == null && + modelClassInfo.declaredAnnotation(ClassNames.MAPPED_SUPERCLASS) == null) { return Collections.emptySet(); } diff --git a/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/JpaJandexScavenger.java b/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/JpaJandexScavenger.java index 05c97b7fe85e7..004eea2b6af15 100644 --- a/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/JpaJandexScavenger.java +++ b/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/JpaJandexScavenger.java @@ -480,7 +480,7 @@ private static void collectPackage(Collector collector, ClassInfo classOrPackage private static void collectModelType(Collector collector, ClassInfo modelClass) { String name = modelClass.name().toString(); collector.modelTypes.add(name); - if (modelClass.classAnnotation(ClassNames.JPA_ENTITY) != null) { + if (modelClass.declaredAnnotation(ClassNames.JPA_ENTITY) != null) { collector.entityTypes.add(name); } } diff --git a/extensions/hibernate-orm/deployment/src/test/java/io/quarkus/hibernate/orm/HibernateOrmAnnotationsTest.java b/extensions/hibernate-orm/deployment/src/test/java/io/quarkus/hibernate/orm/HibernateOrmAnnotationsTest.java index 03a1fa4e4acc0..397b417c66da6 100644 --- a/extensions/hibernate-orm/deployment/src/test/java/io/quarkus/hibernate/orm/HibernateOrmAnnotationsTest.java +++ b/extensions/hibernate-orm/deployment/src/test/java/io/quarkus/hibernate/orm/HibernateOrmAnnotationsTest.java @@ -139,7 +139,7 @@ private Set findClassesWithMethodsAnnotatedWith(Index index, DotName an } private boolean allowsTargetType(ClassInfo annotation, ElementType targetType) { - AnnotationInstance targetAnnotation = annotation.classAnnotation(TARGET); + AnnotationInstance targetAnnotation = annotation.declaredAnnotation(TARGET); if (targetAnnotation == null) { // Can target anything return true; diff --git a/extensions/micrometer/deployment/src/main/java/io/quarkus/micrometer/deployment/binder/mpmetrics/AnnotationHandler.java b/extensions/micrometer/deployment/src/main/java/io/quarkus/micrometer/deployment/binder/mpmetrics/AnnotationHandler.java index 435b94757b4dd..1645ffbe59ef5 100644 --- a/extensions/micrometer/deployment/src/main/java/io/quarkus/micrometer/deployment/binder/mpmetrics/AnnotationHandler.java +++ b/extensions/micrometer/deployment/src/main/java/io/quarkus/micrometer/deployment/binder/mpmetrics/AnnotationHandler.java @@ -52,7 +52,7 @@ public void transform(TransformationContext ctx) { } else if (ctx.isClass()) { classInfo = target.asClass(); // skip @Interceptor - if (target.asClass().classAnnotation(DotNames.INTERCEPTOR) != null) { + if (target.asClass().declaredAnnotation(DotNames.INTERCEPTOR) != null) { return; } } @@ -84,8 +84,8 @@ static boolean removeCountedWhenTimed(DotName sourceAnnotation, AnnotationTarget MethodInfo methodInfo) { if (MetricDotNames.COUNTED_ANNOTATION.equals(sourceAnnotation)) { if (methodInfo == null) { - if (!Annotations.contains(classInfo.classAnnotations(), MetricDotNames.TIMED_ANNOTATION) && - !Annotations.contains(classInfo.classAnnotations(), MetricDotNames.SIMPLY_TIMED_ANNOTATION)) { + if (!Annotations.contains(classInfo.declaredAnnotations(), MetricDotNames.TIMED_ANNOTATION) && + !Annotations.contains(classInfo.declaredAnnotations(), MetricDotNames.SIMPLY_TIMED_ANNOTATION)) { return false; } log.warnf("Bean %s is both counted and timed. The @Counted annotation " + diff --git a/extensions/panache/rest-data-panache/deployment/src/main/java/io/quarkus/rest/data/panache/deployment/properties/ResourcePropertiesProvider.java b/extensions/panache/rest-data-panache/deployment/src/main/java/io/quarkus/rest/data/panache/deployment/properties/ResourcePropertiesProvider.java index b788844076289..fa79af6f29d4a 100644 --- a/extensions/panache/rest-data-panache/deployment/src/main/java/io/quarkus/rest/data/panache/deployment/properties/ResourcePropertiesProvider.java +++ b/extensions/panache/rest-data-panache/deployment/src/main/java/io/quarkus/rest/data/panache/deployment/properties/ResourcePropertiesProvider.java @@ -58,7 +58,7 @@ private Collection collectAnnotationsToCopy(DotName classNam return annotations; } - for (AnnotationInstance annotation : classInfo.classAnnotations()) { + for (AnnotationInstance annotation : classInfo.declaredAnnotations()) { if (ANNOTATIONS_TO_COPY.stream().anyMatch(annotation.name().toString()::startsWith)) { annotations.add(annotation); } @@ -76,8 +76,8 @@ private AnnotationInstance findResourcePropertiesAnnotation(DotName className) { if (classInfo == null) { return null; } - if (classInfo.classAnnotation(RESOURCE_PROPERTIES_ANNOTATION) != null) { - return classInfo.classAnnotation(RESOURCE_PROPERTIES_ANNOTATION); + if (classInfo.declaredAnnotation(RESOURCE_PROPERTIES_ANNOTATION) != null) { + return classInfo.declaredAnnotation(RESOURCE_PROPERTIES_ANNOTATION); } if (classInfo.superName() != null) { return findResourcePropertiesAnnotation(classInfo.superName()); diff --git a/extensions/reactive-routes/deployment/src/main/java/io/quarkus/vertx/web/deployment/ReactiveRoutesProcessor.java b/extensions/reactive-routes/deployment/src/main/java/io/quarkus/vertx/web/deployment/ReactiveRoutesProcessor.java index e39e5c3ec85c3..3f6872a54ac88 100644 --- a/extensions/reactive-routes/deployment/src/main/java/io/quarkus/vertx/web/deployment/ReactiveRoutesProcessor.java +++ b/extensions/reactive-routes/deployment/src/main/java/io/quarkus/vertx/web/deployment/ReactiveRoutesProcessor.java @@ -180,7 +180,7 @@ void validateBeanDeployment( // NOTE: inherited business methods are not taken into account ClassInfo beanClass = bean.getTarget().get().asClass(); AnnotationInstance routeBaseAnnotation = beanClass - .classAnnotation(DotNames.ROUTE_BASE); + .declaredAnnotation(DotNames.ROUTE_BASE); for (MethodInfo method : beanClass.methods()) { if (method.isSynthetic() || Modifier.isStatic(method.flags()) || method.name().equals("")) { continue; diff --git a/extensions/resteasy-classic/rest-client/deployment/src/main/java/io/quarkus/restclient/deployment/RestClientProcessor.java b/extensions/resteasy-classic/rest-client/deployment/src/main/java/io/quarkus/restclient/deployment/RestClientProcessor.java index a4897469c29af..798ee3ea10005 100644 --- a/extensions/resteasy-classic/rest-client/deployment/src/main/java/io/quarkus/restclient/deployment/RestClientProcessor.java +++ b/extensions/resteasy-classic/rest-client/deployment/src/main/java/io/quarkus/restclient/deployment/RestClientProcessor.java @@ -333,7 +333,7 @@ private void warnAboutNotWorkingFeaturesInNative(PackageConfig packageConfig, Ma } Set dotNames = new HashSet<>(); for (ClassInfo interfaze : interfaces.values()) { - if (interfaze.classAnnotation(CLIENT_HEADER_PARAM) != null) { + if (interfaze.declaredAnnotation(CLIENT_HEADER_PARAM) != null) { boolean hasDefault = false; for (MethodInfo method : interfaze.methods()) { if (isDefault(method.flags())) { @@ -448,7 +448,7 @@ private ScopeInfo computeDefaultScope(Capabilities capabilities, Config config, } private String getAnnotationParameter(ClassInfo classInfo, String parameterName) { - AnnotationInstance instance = classInfo.classAnnotation(REGISTER_REST_CLIENT); + AnnotationInstance instance = classInfo.declaredAnnotation(REGISTER_REST_CLIENT); if (instance == null) { return ""; } @@ -566,7 +566,7 @@ void unremovableInterceptors(List restClientInterfaces, Bea ClassInfo restClientClass = index.getClassByName(DotName.createSimple(restClient.getInterfaceName())); if (restClientClass != null) { Set classLevelBindings = new HashSet<>(); - for (AnnotationInstance annotationInstance : restClientClass.classAnnotations()) { + for (AnnotationInstance annotationInstance : restClientClass.declaredAnnotations()) { if (interceptorBindings.contains(annotationInstance.name())) { classLevelBindings.add(annotationInstance); } diff --git a/extensions/resteasy-classic/resteasy-common/deployment/src/main/java/io/quarkus/resteasy/common/deployment/ResteasyCommonProcessor.java b/extensions/resteasy-classic/resteasy-common/deployment/src/main/java/io/quarkus/resteasy/common/deployment/ResteasyCommonProcessor.java index 9d4cc06aa1b13..de8247f62696b 100644 --- a/extensions/resteasy-classic/resteasy-common/deployment/src/main/java/io/quarkus/resteasy/common/deployment/ResteasyCommonProcessor.java +++ b/extensions/resteasy-classic/resteasy-common/deployment/src/main/java/io/quarkus/resteasy/common/deployment/ResteasyCommonProcessor.java @@ -553,7 +553,7 @@ private static boolean collectDeclaredProvidersForMethodAndMediaTypeAnnotation(S if (mediaTypeMethodAnnotationInstance == null) { // no media types defined on the method, let's consider the class annotations AnnotationInstance mediaTypeClassAnnotationInstance = methodTarget.declaringClass() - .classAnnotation(mediaTypeAnnotation); + .declaredAnnotation(mediaTypeAnnotation); if (mediaTypeClassAnnotationInstance != null) { AnnotationValue mediaTypeClassValue = mediaTypeClassAnnotationInstance.value(); if ((mediaTypeClassValue != null) diff --git a/extensions/resteasy-classic/resteasy-server-common/deployment/src/main/java/io/quarkus/resteasy/server/common/deployment/ResteasyServerCommonProcessor.java b/extensions/resteasy-classic/resteasy-server-common/deployment/src/main/java/io/quarkus/resteasy/server/common/deployment/ResteasyServerCommonProcessor.java index dd7cbc6f709cb..72c1dbbe841eb 100644 --- a/extensions/resteasy-classic/resteasy-server-common/deployment/src/main/java/io/quarkus/resteasy/server/common/deployment/ResteasyServerCommonProcessor.java +++ b/extensions/resteasy-classic/resteasy-server-common/deployment/src/main/java/io/quarkus/resteasy/server/common/deployment/ResteasyServerCommonProcessor.java @@ -428,9 +428,9 @@ public boolean appliesTo(Kind kind) { @Override public void transform(TransformationContext context) { ClassInfo clazz = context.getTarget().asClass(); - if (clazz.classAnnotation(ResteasyDotNames.PATH) != null) { + if (clazz.declaredAnnotation(ResteasyDotNames.PATH) != null) { // Root resources - no need to add scope, @Path is a bean defining annotation - if (clazz.classAnnotation(DotNames.TYPED) == null) { + if (clazz.declaredAnnotation(DotNames.TYPED) == null) { // Add @Typed(MyResource.class) context.transform().add(createTypedAnnotationInstance(clazz)).done(); } @@ -440,14 +440,14 @@ public void transform(TransformationContext context) { // Skip classes annotated with built-in scope return; } - if (clazz.classAnnotation(ResteasyDotNames.PROVIDER) != null) { + if (clazz.declaredAnnotation(ResteasyDotNames.PROVIDER) != null) { Transformation transformation = null; if (clazz.annotationsMap().containsKey(DotNames.INJECT) || hasAutoInjectAnnotation(autoInjectAnnotationNames, clazz)) { // A provider with an injection point but no built-in scope is @Singleton transformation = context.transform().add(BuiltinScope.SINGLETON.getName()); } - if (clazz.classAnnotation(DotNames.TYPED) == null) { + if (clazz.declaredAnnotation(DotNames.TYPED) == null) { // Add @Typed(MyProvider.class) if (transformation == null) { transformation = context.transform(); @@ -462,7 +462,7 @@ public void transform(TransformationContext context) { Transformation transformation = context.transform() .add(resteasyConfig.singletonResources ? BuiltinScope.SINGLETON.getName() : BuiltinScope.DEPENDENT.getName()); - if (clazz.classAnnotation(DotNames.TYPED) == null) { + if (clazz.declaredAnnotation(DotNames.TYPED) == null) { // Add @Typed(MySubresource.class) transformation.add(createTypedAnnotationInstance(clazz)); } @@ -675,7 +675,7 @@ private static void generateDefaultConstructors(BuildProducer invocationBuilderEnrichers = new HashMap<>(); String[] consumes = extractProducesConsumesValues( - jandexMethod.declaringClass().classAnnotation(CONSUMES), method.getConsumes()); + jandexMethod.declaringClass().declaredAnnotation(CONSUMES), method.getConsumes()); boolean multipart = isMultipart(consumes, method.getParameters()); AssignableResultHandle formParams = null; @@ -1274,7 +1274,7 @@ private void handleSubResourceMethod(List + ". It may have unresolved parameter types (generics)")); subMethodIndex++; String[] consumes = extractProducesConsumesValues( - jandexSubMethod.declaringClass().classAnnotation(CONSUMES), method.getConsumes()); + jandexSubMethod.declaringClass().declaredAnnotation(CONSUMES), method.getConsumes()); consumes = extractProducesConsumesValues(jandexSubMethod.annotation(CONSUMES), consumes); boolean multipart = isMultipart(consumes, subMethod.getParameters()); @@ -1916,7 +1916,7 @@ private String getHttpMethod(MethodInfo subMethod, String defaultMethod, Map annoToMethod : httpAnnotationToMethod.entrySet()) { - if (subMethod.declaringClass().classAnnotation(annoToMethod.getKey()) != null) { + if (subMethod.declaringClass().declaredAnnotation(annoToMethod.getKey()) != null) { return annoToMethod.getValue(); } } diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jackson/deployment/src/main/java/io/quarkus/resteasy/reactive/jackson/deployment/processor/ResteasyReactiveJacksonProcessor.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jackson/deployment/src/main/java/io/quarkus/resteasy/reactive/jackson/deployment/processor/ResteasyReactiveJacksonProcessor.java index 4c272bf7316ac..679f4a3fbc915 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jackson/deployment/src/main/java/io/quarkus/resteasy/reactive/jackson/deployment/processor/ResteasyReactiveJacksonProcessor.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jackson/deployment/src/main/java/io/quarkus/resteasy/reactive/jackson/deployment/processor/ResteasyReactiveJacksonProcessor.java @@ -279,7 +279,7 @@ public void handleFieldSecurity(ResteasyReactiveResourceMethodEntriesBuildItem r if (methodInfo.hasAnnotation(DISABLE_SECURE_SERIALIZATION)) { continue; } - if (entry.getActualClassInfo().classAnnotation(DISABLE_SECURE_SERIALIZATION) != null) { + if (entry.getActualClassInfo().declaredAnnotation(DISABLE_SECURE_SERIALIZATION) != null) { if (!methodInfo.hasAnnotation(ENABLE_SECURE_SERIALIZATION)) { continue; } diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveProcessor.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveProcessor.java index 7d4574abb0d99..93eceec1e3b36 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveProcessor.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveProcessor.java @@ -1560,7 +1560,7 @@ private String determineApplicationPath(ApplicationScanningResult appResult, return defaultPath.orElse("/"); } AnnotationInstance applicationPathValue = appResult.getSelectedAppClass() - .classAnnotation(ResteasyReactiveDotNames.APPLICATION_PATH); + .declaredAnnotation(ResteasyReactiveDotNames.APPLICATION_PATH); if (applicationPathValue == null) { return defaultPath.orElse("/"); } diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveScanningProcessor.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveScanningProcessor.java index 2d4385c257972..bd97894704a7f 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveScanningProcessor.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveScanningProcessor.java @@ -295,7 +295,7 @@ public void scanForParamConverters(CombinedIndexBuildItem combinedIndexBuildItem ApplicationScanningResult.KeepProviderResult keepProviderResult = applicationResultBuildItem.getResult() .keepProvider(converterClass); if (keepProviderResult != ApplicationScanningResult.KeepProviderResult.DISCARD) { - AnnotationInstance priorityInstance = converterClass.classAnnotation(ResteasyReactiveDotNames.PRIORITY); + AnnotationInstance priorityInstance = converterClass.declaredAnnotation(ResteasyReactiveDotNames.PRIORITY); paramConverterBuildItemBuildProducer.produce(new ParamConverterBuildItem(converterClass.name().toString(), priorityInstance != null ? priorityInstance.value().asInt() : Priorities.USER, true)); } diff --git a/extensions/resteasy-reactive/rest-client-reactive/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/MicroProfileRestClientEnricher.java b/extensions/resteasy-reactive/rest-client-reactive/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/MicroProfileRestClientEnricher.java index d3e9e0188c80b..5f22e57c186b3 100644 --- a/extensions/resteasy-reactive/rest-client-reactive/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/MicroProfileRestClientEnricher.java +++ b/extensions/resteasy-reactive/rest-client-reactive/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/MicroProfileRestClientEnricher.java @@ -134,7 +134,7 @@ public void forClass(MethodCreator constructor, AssignableResultHandle webTarget ResultHandle clientHeadersFactory = null; - AnnotationInstance registerClientHeaders = interfaceClass.classAnnotation(REGISTER_CLIENT_HEADERS); + AnnotationInstance registerClientHeaders = interfaceClass.declaredAnnotation(REGISTER_CLIENT_HEADERS); if (registerClientHeaders != null) { String headersFactoryClass = registerClientHeaders.valueWithDefault(index) @@ -475,14 +475,14 @@ private void createAndReturnHeaderFiller(ClassCreator classCreator, MethodCreato private void collectHeaderFillers(ClassInfo interfaceClass, MethodInfo method, Map headerFillersByName) { - AnnotationInstance classLevelHeader = interfaceClass.classAnnotation(CLIENT_HEADER_PARAM); + AnnotationInstance classLevelHeader = interfaceClass.declaredAnnotation(CLIENT_HEADER_PARAM); if (classLevelHeader != null) { headerFillersByName.put(classLevelHeader.value("name").asString(), new HeaderData(classLevelHeader, interfaceClass)); } putAllHeaderAnnotations(headerFillersByName, interfaceClass, - extractAnnotations(interfaceClass.classAnnotation(CLIENT_HEADER_PARAMS))); + extractAnnotations(interfaceClass.declaredAnnotation(CLIENT_HEADER_PARAMS))); Map methodLevelHeadersByName = new HashMap<>(); AnnotationInstance methodLevelHeader = method.annotation(CLIENT_HEADER_PARAM); diff --git a/extensions/resteasy-reactive/rest-client-reactive/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/RestClientReactiveProcessor.java b/extensions/resteasy-reactive/rest-client-reactive/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/RestClientReactiveProcessor.java index d456cbea6cdb4..0af9df3ca2dcb 100644 --- a/extensions/resteasy-reactive/rest-client-reactive/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/RestClientReactiveProcessor.java +++ b/extensions/resteasy-reactive/rest-client-reactive/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/RestClientReactiveProcessor.java @@ -293,7 +293,7 @@ void registerProvidersFromAnnotations(CombinedIndexBuildItem indexBuildItem, // ignore providers annotated with `@ConstrainedTo(SERVER)` AnnotationInstance constrainedToInstance = providerClass - .classAnnotation(ResteasyReactiveDotNames.CONSTRAINED_TO); + .declaredAnnotation(ResteasyReactiveDotNames.CONSTRAINED_TO); if (constrainedToInstance != null) { if (RuntimeType.valueOf(constrainedToInstance.value().asEnum()) == RuntimeType.SERVER) { continue; @@ -619,7 +619,7 @@ private int getAnnotatedPriority(IndexView index, String className, int defaultP log.warnv("Unindexed provider class {0}. The priority of the provider will be set to {1}. ", className, defaultPriority); } else { - AnnotationInstance priorityAnnoOnProvider = providerClass.classAnnotation(ResteasyReactiveDotNames.PRIORITY); + AnnotationInstance priorityAnnoOnProvider = providerClass.declaredAnnotation(ResteasyReactiveDotNames.PRIORITY); if (priorityAnnoOnProvider != null) { priority = priorityAnnoOnProvider.value().asInt(); } @@ -631,7 +631,7 @@ private int getAnnotatedPriority(IndexView index, String className, int defaultP // In order to avoid the extra complexity of having to deal with this mode, we simply fail the build when this situation is encountered // and provide an actionable error message on how to remedy the situation. private void validateKotlinDefaultMethods(ClassInfo jaxrsInterface, IndexView index) { - if (jaxrsInterface.classAnnotation(KOTLIN_METADATA_ANNOTATION) != null) { + if (jaxrsInterface.declaredAnnotation(KOTLIN_METADATA_ANNOTATION) != null) { var potentialDefaultImplClass = DotName .createSimple(jaxrsInterface.name().toString() + KOTLIN_INTERFACE_DEFAULT_IMPL_SUFFIX); if (index.getClassByName(potentialDefaultImplClass) != null) { diff --git a/extensions/smallrye-health/deployment/src/main/java/io/quarkus/smallrye/health/deployment/SmallRyeHealthProcessor.java b/extensions/smallrye-health/deployment/src/main/java/io/quarkus/smallrye/health/deployment/SmallRyeHealthProcessor.java index 450d6ba69bed3..26f570bb4b700 100644 --- a/extensions/smallrye-health/deployment/src/main/java/io/quarkus/smallrye/health/deployment/SmallRyeHealthProcessor.java +++ b/extensions/smallrye-health/deployment/src/main/java/io/quarkus/smallrye/health/deployment/SmallRyeHealthProcessor.java @@ -317,7 +317,7 @@ private void warnIfJaxRsPathUsed(IndexView index, DotName healthAnnotation) { AnnotationTarget target = instance.target(); if (target.kind() == Kind.CLASS) { - if (target.asClass().classAnnotation(JAX_RS_PATH) != null) { + if (target.asClass().declaredAnnotation(JAX_RS_PATH) != null) { containsPath = true; } } else if (target.kind() == Kind.METHOD) { diff --git a/extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/RESTEasyExtension.java b/extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/RESTEasyExtension.java index 260ba3e5a539e..ee71c46f19bd9 100644 --- a/extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/RESTEasyExtension.java +++ b/extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/RESTEasyExtension.java @@ -73,7 +73,7 @@ private void scanAsyncResponseProvidersFromClassName(Class asyncResponseProvi private void scanAsyncResponseProviders(IndexView index) { for (ClassInfo providerClass : index.getAllKnownImplementors(DOTNAME_ASYNC_RESPONSE_PROVIDER)) { - for (AnnotationInstance annotation : providerClass.classAnnotations()) { + for (AnnotationInstance annotation : providerClass.declaredAnnotations()) { if (annotation.name().equals(DOTNAME_PROVIDER)) { for (Type interf : providerClass.interfaceTypes()) { if (interf.kind() == Type.Kind.PARAMETERIZED_TYPE diff --git a/extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/SmallRyeOpenApiProcessor.java b/extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/SmallRyeOpenApiProcessor.java index b5d09571f7ed3..9ccfa58654fa5 100644 --- a/extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/SmallRyeOpenApiProcessor.java +++ b/extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/SmallRyeOpenApiProcessor.java @@ -595,7 +595,7 @@ void addMethodImplementationClassNames(MethodInfo method, Type[] params, Collect private boolean isValidOpenAPIMethodForAutoAdd(MethodInfo method, DotName securityRequirement) { return isOpenAPIEndpoint(method) && !method.hasAnnotation(securityRequirement) - && method.declaringClass().classAnnotation(securityRequirement) == null; + && method.declaringClass().declaredAnnotation(securityRequirement) == null; } @BuildStep diff --git a/extensions/smallrye-reactive-messaging/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/deployment/WiringHelper.java b/extensions/smallrye-reactive-messaging/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/deployment/WiringHelper.java index c09bffb28ef62..f54afe684ac43 100644 --- a/extensions/smallrye-reactive-messaging/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/deployment/WiringHelper.java +++ b/extensions/smallrye-reactive-messaging/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/deployment/WiringHelper.java @@ -136,10 +136,10 @@ static boolean isOutboundConnector(ClassInfo ci) { static List getConnectorAttributes(BeanInfo bi, CombinedIndexBuildItem index, ConnectorAttribute.Direction... directions) { List attributes = bi.getImplClazz() - .classAnnotationsWithRepeatable(ReactiveMessagingDotNames.CONNECTOR_ATTRIBUTES, index.getIndex()) + .declaredAnnotationsWithRepeatable(ReactiveMessagingDotNames.CONNECTOR_ATTRIBUTES, index.getIndex()) .stream().flatMap(ai -> Arrays.stream(ai.value().asNestedArray())).collect(Collectors.toList()); if (attributes.isEmpty()) { - AnnotationInstance attribute = bi.getImplClazz().classAnnotation(ReactiveMessagingDotNames.CONNECTOR_ATTRIBUTE); + AnnotationInstance attribute = bi.getImplClazz().declaredAnnotation(ReactiveMessagingDotNames.CONNECTOR_ATTRIBUTE); if (attribute != null) { attributes = Collections.singletonList(attribute); } diff --git a/extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/MethodNameParser.java b/extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/MethodNameParser.java index c5886556091dd..29e0131fb2b9f 100644 --- a/extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/MethodNameParser.java +++ b/extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/MethodNameParser.java @@ -504,7 +504,7 @@ private String lowerFirstLetter(String input) { } private String getEntityName() { - AnnotationInstance annotationInstance = entityClass.classAnnotation(DotNames.JPA_ENTITY); + AnnotationInstance annotationInstance = entityClass.declaredAnnotation(DotNames.JPA_ENTITY); if (annotationInstance != null && annotationInstance.value("name") != null) { AnnotationValue annotationValue = annotationInstance.value("name"); return annotationValue.asString().length() > 0 ? annotationValue.asString() : entityClass.simpleName(); @@ -548,9 +548,9 @@ private List getSuperClassInfos(IndexView indexView, ClassInfo entity Type superClassType = entityClass.superClassType(); while (superClassType != null && !superClassType.name().equals(DotNames.OBJECT)) { ClassInfo superClass = indexView.getClassByName(superClassType.name()); - if (superClass.classAnnotation(DotNames.JPA_MAPPED_SUPERCLASS) != null) { + if (superClass.declaredAnnotation(DotNames.JPA_MAPPED_SUPERCLASS) != null) { mappedSuperClassInfoElements.add(superClass); - } else if (superClass.classAnnotation(DotNames.JPA_INHERITANCE) != null) { + } else if (superClass.declaredAnnotation(DotNames.JPA_INHERITANCE) != null) { mappedSuperClassInfoElements.add(superClass); } diff --git a/extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/generate/GenerationUtil.java b/extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/generate/GenerationUtil.java index f85c020a2b950..a6c36e801fa77 100644 --- a/extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/generate/GenerationUtil.java +++ b/extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/generate/GenerationUtil.java @@ -81,7 +81,7 @@ static AnnotationInstance getNamedQueryForMethod(MethodInfo methodInfo, ClassInf private static AnnotationInstance getNamedQueryAnnotationForMethod(MethodInfo methodInfo, ClassInfo entityClassInfo) { String methodName = methodInfo.name(); - AnnotationInstance namedQueryAnnotation = entityClassInfo.classAnnotation(JPA_NAMED_QUERY); + AnnotationInstance namedQueryAnnotation = entityClassInfo.declaredAnnotation(JPA_NAMED_QUERY); if (namedQueryAnnotation != null && isMethodDeclaredInNamedQuery(entityClassInfo, methodName, namedQueryAnnotation)) { return namedQueryAnnotation; } @@ -91,7 +91,7 @@ private static AnnotationInstance getNamedQueryAnnotationForMethod(MethodInfo me private static AnnotationInstance getNamedQueriesAnnotationForMethod(MethodInfo methodInfo, ClassInfo entityClassInfo) { String methodName = methodInfo.name(); - AnnotationInstance namedQueriesAnnotation = entityClassInfo.classAnnotation(JPA_NAMED_QUERIES); + AnnotationInstance namedQueriesAnnotation = entityClassInfo.declaredAnnotation(JPA_NAMED_QUERIES); if (namedQueriesAnnotation != null) { for (AnnotationValue annotationInstanceValues : namedQueriesAnnotation.values()) { for (AnnotationInstance annotationInstance : annotationInstanceValues.asNestedArray()) { diff --git a/extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/generate/SpringDataRepositoryCreator.java b/extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/generate/SpringDataRepositoryCreator.java index a54aab834ac5b..ebf95e67283d3 100644 --- a/extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/generate/SpringDataRepositoryCreator.java +++ b/extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/generate/SpringDataRepositoryCreator.java @@ -125,7 +125,7 @@ public Result implementCrudRepository(ClassInfo repositoryToImplement, IndexView private Map.Entry extractIdAndEntityTypes(ClassInfo repositoryToImplement, IndexView indexView) { AnnotationInstance repositoryDefinitionInstance = repositoryToImplement - .classAnnotation(DotNames.SPRING_DATA_REPOSITORY_DEFINITION); + .declaredAnnotation(DotNames.SPRING_DATA_REPOSITORY_DEFINITION); if (repositoryDefinitionInstance != null) { return new AbstractMap.SimpleEntry<>(repositoryDefinitionInstance.value("idClass").asClass().name(), repositoryDefinitionInstance.value("domainClass").asClass().name()); diff --git a/extensions/spring-data-rest/deployment/src/main/java/io/quarkus/spring/data/rest/deployment/ResourcePropertiesProvider.java b/extensions/spring-data-rest/deployment/src/main/java/io/quarkus/spring/data/rest/deployment/ResourcePropertiesProvider.java index bbdf467979e7b..06ab7894183d8 100644 --- a/extensions/spring-data-rest/deployment/src/main/java/io/quarkus/spring/data/rest/deployment/ResourcePropertiesProvider.java +++ b/extensions/spring-data-rest/deployment/src/main/java/io/quarkus/spring/data/rest/deployment/ResourcePropertiesProvider.java @@ -82,7 +82,7 @@ private Collection collectAnnotationsToCopy(DotName classNam return annotations; } - for (AnnotationInstance annotation : classInfo.classAnnotations()) { + for (AnnotationInstance annotation : classInfo.declaredAnnotations()) { if (ANNOTATIONS_TO_COPY.stream().anyMatch(annotation.name().toString()::startsWith)) { annotations.add(annotation); } @@ -100,11 +100,11 @@ private AnnotationInstance findClassAnnotation(DotName interfaceName) { if (classInfo == null) { return null; } - if (classInfo.classAnnotation(REPOSITORY_REST_RESOURCE_ANNOTATION) != null) { - return classInfo.classAnnotation(REPOSITORY_REST_RESOURCE_ANNOTATION); + if (classInfo.declaredAnnotation(REPOSITORY_REST_RESOURCE_ANNOTATION) != null) { + return classInfo.declaredAnnotation(REPOSITORY_REST_RESOURCE_ANNOTATION); } - if (classInfo.classAnnotation(REST_RESOURCE_ANNOTATION) != null) { - return classInfo.classAnnotation(REST_RESOURCE_ANNOTATION); + if (classInfo.declaredAnnotation(REST_RESOURCE_ANNOTATION) != null) { + return classInfo.declaredAnnotation(REST_RESOURCE_ANNOTATION); } if (classInfo.superName() != null) { return findClassAnnotation(classInfo.superName()); diff --git a/extensions/spring-di/deployment/src/main/java/io/quarkus/spring/di/deployment/SpringDIProcessor.java b/extensions/spring-di/deployment/src/main/java/io/quarkus/spring/di/deployment/SpringDIProcessor.java index 948279b18d92d..62fb49fc13245 100644 --- a/extensions/spring-di/deployment/src/main/java/io/quarkus/spring/di/deployment/SpringDIProcessor.java +++ b/extensions/spring-di/deployment/src/main/java/io/quarkus/spring/di/deployment/SpringDIProcessor.java @@ -210,10 +210,10 @@ Map> getStereotypeScopes(final IndexView index) { private DotName getScope(final AnnotationTarget target) { AnnotationValue value = null; if (target.kind() == AnnotationTarget.Kind.CLASS) { - if (target.asClass().classAnnotation(SPRING_SCOPE_ANNOTATION) != null) { - value = target.asClass().classAnnotation(SPRING_SCOPE_ANNOTATION).value(); + if (target.asClass().declaredAnnotation(SPRING_SCOPE_ANNOTATION) != null) { + value = target.asClass().declaredAnnotation(SPRING_SCOPE_ANNOTATION).value(); if ((value == null) || value.asString().isEmpty()) { - value = target.asClass().classAnnotation(SPRING_SCOPE_ANNOTATION).value("scopeName"); + value = target.asClass().declaredAnnotation(SPRING_SCOPE_ANNOTATION).value("scopeName"); } } } else if (target.kind() == AnnotationTarget.Kind.METHOD) { @@ -308,7 +308,7 @@ Set getAnnotationsToAdd( final Set names = new HashSet<>(); final Set clazzAnnotations = classInfo.annotationsMap().keySet(); - for (AnnotationInstance instance : classInfo.classAnnotations()) { + for (AnnotationInstance instance : classInfo.declaredAnnotations()) { // make sure that we don't mix and match Spring and CDI annotations since this can cause a lot of problems if (arcScopes.contains(instance.name())) { return annotationsToAdd; @@ -323,13 +323,13 @@ Set getAnnotationsToAdd( scopes.addAll(scopeNames); } if (SPRING_STEREOTYPE_ANNOTATIONS.contains(clazzAnnotation) && !classInfo.isAnnotation()) { - names.add(getBeanNameFromStereotypeInstance(classInfo.classAnnotation(clazzAnnotation))); + names.add(getBeanNameFromStereotypeInstance(classInfo.declaredAnnotation(clazzAnnotation))); } } } DotName declaredScope = getScope(classInfo); // @Named is a bean-defining annotation in Spring, but not in Arc. - if (declaredScope == null && classInfo.classAnnotation(CDI_NAMED_ANNOTATION) != null) { + if (declaredScope == null && classInfo.declaredAnnotation(CDI_NAMED_ANNOTATION) != null) { declaredScope = CDI_SINGLETON_ANNOTATION; // implicit default scope in spring } final boolean isAnnotation = classInfo.isAnnotation(); @@ -406,7 +406,7 @@ Set getAnnotationsToAdd( } else if (target.kind() == AnnotationTarget.Kind.METHOD) { final MethodInfo methodInfo = target.asMethod(); if (methodInfo.hasAnnotation(BEAN_ANNOTATION) - && methodInfo.declaringClass().classAnnotation(CONFIGURATION_ANNOTATION) != null) { + && methodInfo.declaringClass().declaredAnnotation(CONFIGURATION_ANNOTATION) != null) { annotationsToAdd.add(create( CDI_PRODUCES_ANNOTATION, target, diff --git a/extensions/spring-security/deployment/src/main/java/io/quarkus/spring/security/deployment/SpringSecurityProcessor.java b/extensions/spring-security/deployment/src/main/java/io/quarkus/spring/security/deployment/SpringSecurityProcessor.java index d12ec9b0a6cba..70d16090e0090 100644 --- a/extensions/spring-security/deployment/src/main/java/io/quarkus/spring/security/deployment/SpringSecurityProcessor.java +++ b/extensions/spring-security/deployment/src/main/java/io/quarkus/spring/security/deployment/SpringSecurityProcessor.java @@ -234,7 +234,7 @@ void locatePreAuthorizedInstances( } MethodInfo methodInfo = instance.target().asMethod(); checksStandardSecurity(instance, methodInfo); - result.put(methodInfo, metaAnnotation.classAnnotation(DotNames.SPRING_PRE_AUTHORIZE)); + result.put(methodInfo, metaAnnotation.declaredAnnotation(DotNames.SPRING_PRE_AUTHORIZE)); classesInNeedOfAnnotationTransformation.add(methodInfo.declaringClass().name()); } } diff --git a/extensions/spring-web/core/deployment/src/main/java/io/quarkus/spring/web/deployment/ResponseStatusOnExceptionGenerator.java b/extensions/spring-web/core/deployment/src/main/java/io/quarkus/spring/web/deployment/ResponseStatusOnExceptionGenerator.java index cf6394e19969a..0cb16f6ea52ed 100644 --- a/extensions/spring-web/core/deployment/src/main/java/io/quarkus/spring/web/deployment/ResponseStatusOnExceptionGenerator.java +++ b/extensions/spring-web/core/deployment/src/main/java/io/quarkus/spring/web/deployment/ResponseStatusOnExceptionGenerator.java @@ -19,7 +19,8 @@ class ResponseStatusOnExceptionGenerator extends AbstractExceptionMapperGenerato } void generateMethodBody(MethodCreator toResponse) { - ResultHandle status = toResponse.load(getHttpStatusFromAnnotation(exceptionClassInfo.classAnnotation(RESPONSE_STATUS))); + ResultHandle status = toResponse + .load(getHttpStatusFromAnnotation(exceptionClassInfo.declaredAnnotation(RESPONSE_STATUS))); ResultHandle responseBuilder = toResponse.invokeStaticMethod( MethodDescriptor.ofMethod(Response.class, "status", Response.ResponseBuilder.class, int.class), status); diff --git a/extensions/spring-web/resteasy-classic/deployment/src/main/java/io/quarkus/spring/web/deployment/SpringWebResteasyClassicProcessor.java b/extensions/spring-web/resteasy-classic/deployment/src/main/java/io/quarkus/spring/web/deployment/SpringWebResteasyClassicProcessor.java index a1af08f6bc7fa..e30a406ab6534 100644 --- a/extensions/spring-web/resteasy-classic/deployment/src/main/java/io/quarkus/spring/web/deployment/SpringWebResteasyClassicProcessor.java +++ b/extensions/spring-web/resteasy-classic/deployment/src/main/java/io/quarkus/spring/web/deployment/SpringWebResteasyClassicProcessor.java @@ -148,7 +148,7 @@ private void validateControllers(BeanArchiveIndexBuildItem beanArchiveIndexBuild continue; } - if (targetClass.classAnnotation(REST_CONTROLLER_ANNOTATION) == null) { + if (targetClass.declaredAnnotation(REST_CONTROLLER_ANNOTATION) == null) { classesWithoutRestController.add(targetClass.name()); } } @@ -248,7 +248,7 @@ public void registerWithDevModeNotFoundMapper(BeanArchiveIndexBuildItem beanArch String basePath = "/"; ClassInfo restControllerAnnotatedClass = restControllerInstance.target().asClass(); - AnnotationInstance requestMappingInstance = restControllerAnnotatedClass.classAnnotation(REQUEST_MAPPING); + AnnotationInstance requestMappingInstance = restControllerAnnotatedClass.declaredAnnotation(REQUEST_MAPPING); if (requestMappingInstance != null) { String basePathFromAnnotation = getMappingValue(requestMappingInstance); if (basePathFromAnnotation != null) { diff --git a/extensions/spring-web/resteasy-reactive/deployment/src/main/java/io/quarkus/spring/web/deployment/SpringWebResteasyReactiveProcessor.java b/extensions/spring-web/resteasy-reactive/deployment/src/main/java/io/quarkus/spring/web/deployment/SpringWebResteasyReactiveProcessor.java index caf747df1bc90..e33a2ab086355 100644 --- a/extensions/spring-web/resteasy-reactive/deployment/src/main/java/io/quarkus/spring/web/deployment/SpringWebResteasyReactiveProcessor.java +++ b/extensions/spring-web/resteasy-reactive/deployment/src/main/java/io/quarkus/spring/web/deployment/SpringWebResteasyReactiveProcessor.java @@ -112,7 +112,7 @@ public void registerAdditionalResourceClasses(CombinedIndexBuildItem index, .getAnnotations(REST_CONTROLLER_ANNOTATION)) { ClassInfo targetClass = restController.target().asClass(); additionalResourceClassProducer.produce(new AdditionalResourceClassBuildItem(targetClass, - getSinglePathOfInstance(targetClass.classAnnotation(REQUEST_MAPPING), ""))); + getSinglePathOfInstance(targetClass.declaredAnnotation(REQUEST_MAPPING), ""))); } } @@ -133,7 +133,7 @@ private void validateControllers(IndexView index) { continue; } - if (targetClass.classAnnotation(REST_CONTROLLER_ANNOTATION) == null) { + if (targetClass.declaredAnnotation(REST_CONTROLLER_ANNOTATION) == null) { classesWithoutRestController.add(targetClass.name()); } } diff --git a/extensions/undertow/deployment/src/main/java/io/quarkus/undertow/deployment/UndertowBuildStep.java b/extensions/undertow/deployment/src/main/java/io/quarkus/undertow/deployment/UndertowBuildStep.java index cb16d4b1a3b93..06fd8dd5d7169 100644 --- a/extensions/undertow/deployment/src/main/java/io/quarkus/undertow/deployment/UndertowBuildStep.java +++ b/extensions/undertow/deployment/src/main/java/io/quarkus/undertow/deployment/UndertowBuildStep.java @@ -277,7 +277,7 @@ public List servletContainerInitializer( beans.produce(AdditionalBeanBuildItem.unremovableOf(initializer)); ClassInfo sci = combinedIndexBuildItem.getIndex().getClassByName(DotName.createSimple(initializer)); if (sci != null) { - AnnotationInstance handles = sci.classAnnotation(HANDLES_TYPES); + AnnotationInstance handles = sci.declaredAnnotation(HANDLES_TYPES); Set handledTypes = new HashSet<>(); if (handles != null) { Type[] types = handles.value().asClassArray(); diff --git a/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/NameBindingUtil.java b/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/NameBindingUtil.java index 0b860c23b4cd2..d545a2cd5cf65 100644 --- a/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/NameBindingUtil.java +++ b/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/NameBindingUtil.java @@ -54,7 +54,7 @@ private static Set nameBindingNames(IndexView index, Collection if (classAnnotation == null) { continue; } - if (classAnnotation.classAnnotation(NAME_BINDING) != null) { + if (classAnnotation.declaredAnnotation(NAME_BINDING) != null) { result.add(classAnnotation.name().toString()); } } diff --git a/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/scanning/ApplicationScanningResult.java b/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/scanning/ApplicationScanningResult.java index a881ada5317a2..c7fd2a5579ac1 100644 --- a/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/scanning/ApplicationScanningResult.java +++ b/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/scanning/ApplicationScanningResult.java @@ -45,7 +45,7 @@ public KeepProviderResult keepProvider(ClassInfo providerClass) { : KeepProviderResult.DISCARD; } } - return providerClass.classAnnotation(ResteasyReactiveDotNames.PROVIDER) != null ? KeepProviderResult.NORMAL + return providerClass.declaredAnnotation(ResteasyReactiveDotNames.PROVIDER) != null ? KeepProviderResult.NORMAL : KeepProviderResult.DISCARD; } diff --git a/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/scanning/ResteasyReactiveInterceptorScanner.java b/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/scanning/ResteasyReactiveInterceptorScanner.java index a0d59b90321dc..ccc0cbcca9eec 100644 --- a/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/scanning/ResteasyReactiveInterceptorScanner.java +++ b/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/scanning/ResteasyReactiveInterceptorScanner.java @@ -201,16 +201,16 @@ private static ResourceInterceptor handleDiscoveredInterceptor( ResourceInterceptor interceptor = interceptorContainer.create(); interceptor.setClassName(filterClass.name().toString()); interceptor.setNameBindingNames(NameBindingUtil.nameBindingNames(index, filterClass)); - AnnotationInstance priorityInstance = filterClass.classAnnotation(PRIORITY); + AnnotationInstance priorityInstance = filterClass.declaredAnnotation(PRIORITY); if (priorityInstance != null) { interceptor.setPriority(priorityInstance.value().asInt()); } - AnnotationInstance nonBlockingInstance = filterClass.classAnnotation(NON_BLOCKING); + AnnotationInstance nonBlockingInstance = filterClass.declaredAnnotation(NON_BLOCKING); if (nonBlockingInstance != null) { interceptor.setNonBlockingRequired(true); } if (interceptorContainer instanceof PreMatchInterceptorContainer - && filterClass.classAnnotation(PRE_MATCHING) != null) { + && filterClass.declaredAnnotation(PRE_MATCHING) != null) { ((PreMatchInterceptorContainer) interceptorContainer).addPreMatchInterceptor(interceptor); } else { Set nameBindingNames = interceptor.getNameBindingNames(); diff --git a/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/scanning/ResteasyReactiveScanner.java b/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/scanning/ResteasyReactiveScanner.java index 5598c9ef65087..772015b57e6b6 100644 --- a/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/scanning/ResteasyReactiveScanner.java +++ b/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/scanning/ResteasyReactiveScanner.java @@ -116,13 +116,13 @@ public static ApplicationScanningResult scanForApplicationClass(IndexView index, | InvocationTargetException e) { throw new RuntimeException("Unable to handle class: " + applicationClass, e); } - if (applicationClassInfo.classAnnotation(ResteasyReactiveDotNames.BLOCKING) != null) { - if (applicationClassInfo.classAnnotation(ResteasyReactiveDotNames.NON_BLOCKING) != null) { + if (applicationClassInfo.declaredAnnotation(ResteasyReactiveDotNames.BLOCKING) != null) { + if (applicationClassInfo.declaredAnnotation(ResteasyReactiveDotNames.NON_BLOCKING) != null) { throw new DeploymentException("JAX-RS Application class '" + applicationClassInfo.name() + "' contains both @Blocking and @NonBlocking annotations."); } blocking = BlockingDefault.BLOCKING; - } else if (applicationClassInfo.classAnnotation(ResteasyReactiveDotNames.NON_BLOCKING) != null) { + } else if (applicationClassInfo.declaredAnnotation(ResteasyReactiveDotNames.NON_BLOCKING) != null) { blocking = BlockingDefault.NON_BLOCKING; } } @@ -153,16 +153,17 @@ public static SerializerScanningResult scanForSerializers(IndexView index, runtimeType = RuntimeType.SERVER; } List mediaTypeStrings = Collections.emptyList(); - AnnotationInstance consumesAnnotation = readerClass.classAnnotation(ResteasyReactiveDotNames.CONSUMES); + AnnotationInstance consumesAnnotation = readerClass.declaredAnnotation(ResteasyReactiveDotNames.CONSUMES); if (consumesAnnotation != null) { mediaTypeStrings = Arrays.asList(consumesAnnotation.value().asStringArray()); } - AnnotationInstance constrainedToInstance = readerClass.classAnnotation(ResteasyReactiveDotNames.CONSTRAINED_TO); + AnnotationInstance constrainedToInstance = readerClass + .declaredAnnotation(ResteasyReactiveDotNames.CONSTRAINED_TO); if (constrainedToInstance != null) { runtimeType = RuntimeType.valueOf(constrainedToInstance.value().asEnum()); } int priority = Priorities.USER; - AnnotationInstance priorityInstance = readerClass.classAnnotation(ResteasyReactiveDotNames.PRIORITY); + AnnotationInstance priorityInstance = readerClass.declaredAnnotation(ResteasyReactiveDotNames.PRIORITY); if (priorityInstance != null) { priority = priorityInstance.value().asInt(); } @@ -184,19 +185,20 @@ public static SerializerScanningResult scanForSerializers(IndexView index, runtimeType = RuntimeType.SERVER; } List mediaTypeStrings = Collections.emptyList(); - AnnotationInstance producesAnnotation = writerClass.classAnnotation(ResteasyReactiveDotNames.PRODUCES); + AnnotationInstance producesAnnotation = writerClass.declaredAnnotation(ResteasyReactiveDotNames.PRODUCES); if (producesAnnotation != null) { mediaTypeStrings = Arrays.asList(producesAnnotation.value().asStringArray()); } List typeParameters = JandexUtil.resolveTypeParameters(writerClass.name(), ResteasyReactiveDotNames.MESSAGE_BODY_WRITER, index); - AnnotationInstance constrainedToInstance = writerClass.classAnnotation(ResteasyReactiveDotNames.CONSTRAINED_TO); + AnnotationInstance constrainedToInstance = writerClass + .declaredAnnotation(ResteasyReactiveDotNames.CONSTRAINED_TO); if (constrainedToInstance != null) { runtimeType = RuntimeType.valueOf(constrainedToInstance.value().asEnum()); } int priority = Priorities.USER; - AnnotationInstance priorityInstance = writerClass.classAnnotation(ResteasyReactiveDotNames.PRIORITY); + AnnotationInstance priorityInstance = writerClass.declaredAnnotation(ResteasyReactiveDotNames.PRIORITY); if (priorityInstance != null) { priority = priorityInstance.value().asInt(); } diff --git a/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/ResteasyReactiveDeploymentManager.java b/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/ResteasyReactiveDeploymentManager.java index b93204e85a9c9..cae40343c58aa 100644 --- a/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/ResteasyReactiveDeploymentManager.java +++ b/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/ResteasyReactiveDeploymentManager.java @@ -451,7 +451,7 @@ private String getApplicationPath() { String path = "/"; if (sa.applicationScanningResult.getSelectedAppClass() != null) { var pathAn = sa.applicationScanningResult.getSelectedAppClass() - .classAnnotation(ResteasyReactiveDotNames.APPLICATION_PATH); + .declaredAnnotation(ResteasyReactiveDotNames.APPLICATION_PATH); if (pathAn != null) { path = pathAn.value().asString(); if (!path.startsWith("/")) { diff --git a/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/generation/filters/FilterGeneration.java b/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/generation/filters/FilterGeneration.java index 7b6508ecc7713..2127ea5744b93 100644 --- a/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/generation/filters/FilterGeneration.java +++ b/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/generation/filters/FilterGeneration.java @@ -81,7 +81,7 @@ public static List generate(IndexView index, Set unwra if (annotationClassInfo == null) { continue; } - if ((annotationClassInfo.classAnnotation(ResteasyReactiveDotNames.NAME_BINDING) != null)) { + if ((annotationClassInfo.declaredAnnotation(ResteasyReactiveDotNames.NAME_BINDING) != null)) { nameBindingNames.add(annotationDotName.toString()); } } @@ -116,7 +116,7 @@ public static List generate(IndexView index, Set unwra if (annotationClassInfo == null) { continue; } - if ((annotationClassInfo.classAnnotation(ResteasyReactiveDotNames.NAME_BINDING) != null)) { + if ((annotationClassInfo.declaredAnnotation(ResteasyReactiveDotNames.NAME_BINDING) != null)) { nameBindingNames.add(annotationDotName.toString()); } } diff --git a/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/scanning/CacheControlScanner.java b/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/scanning/CacheControlScanner.java index 42515769cea4f..f89391bb8764e 100644 --- a/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/scanning/CacheControlScanner.java +++ b/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/scanning/CacheControlScanner.java @@ -39,7 +39,7 @@ public List scan(MethodInfo method, ClassInfo actualEndp } else { cacheControl = noCacheToCacheControl(annotationStore.getAnnotation(actualEndpointClass, NO_CACHE)); if (cacheControl != null) { - if (actualEndpointClass.classAnnotation(CACHE) != null) { + if (actualEndpointClass.declaredAnnotation(CACHE) != null) { throw new IllegalStateException( "A resource class cannot be simultaneously annotated with '@Cache' and '@NoCache'. Offending class is '" + actualEndpointClass.name() + "'"); @@ -52,7 +52,7 @@ public List scan(MethodInfo method, ClassInfo actualEndp if (cacheControl != null) { return cacheControlToCustomizerList(cacheControl); } else { - cacheControl = cacheToCacheControl(actualEndpointClass.classAnnotation(CACHE)); + cacheControl = cacheToCacheControl(actualEndpointClass.declaredAnnotation(CACHE)); if (cacheControl != null) { return cacheControlToCustomizerList(cacheControl); } diff --git a/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/scanning/ResteasyReactiveContextResolverScanner.java b/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/scanning/ResteasyReactiveContextResolverScanner.java index a97d8ac090ba6..ca4301b990c02 100644 --- a/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/scanning/ResteasyReactiveContextResolverScanner.java +++ b/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/scanning/ResteasyReactiveContextResolverScanner.java @@ -70,7 +70,7 @@ public static ContextResolvers scanForContextResolvers(IndexView index, Applicat } private static List getProducesMediaTypes(ClassInfo classInfo) { - AnnotationInstance produces = classInfo.classAnnotation(ResteasyReactiveDotNames.PRODUCES); + AnnotationInstance produces = classInfo.declaredAnnotation(ResteasyReactiveDotNames.PRODUCES); if (produces == null) { return Collections.emptyList(); } diff --git a/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/scanning/ResteasyReactiveExceptionMappingScanner.java b/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/scanning/ResteasyReactiveExceptionMappingScanner.java index 4c982d005a34b..9b8e3c50dd0ec 100644 --- a/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/scanning/ResteasyReactiveExceptionMappingScanner.java +++ b/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/scanning/ResteasyReactiveExceptionMappingScanner.java @@ -53,7 +53,7 @@ public static ExceptionMapping scanForExceptionMappers(IndexView index, Applicat ResteasyReactiveDotNames.EXCEPTION_MAPPER, index); DotName handledExceptionDotName = typeParameters.get(0).name(); - AnnotationInstance priorityInstance = mapperClass.classAnnotation(ResteasyReactiveDotNames.PRIORITY); + AnnotationInstance priorityInstance = mapperClass.declaredAnnotation(ResteasyReactiveDotNames.PRIORITY); int priority = Priorities.USER; if (priorityInstance != null) { priority = priorityInstance.value().asInt(); diff --git a/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/scanning/ResteasyReactiveParamConverterScanner.java b/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/scanning/ResteasyReactiveParamConverterScanner.java index 2c6f8e2654396..99dbea7645957 100644 --- a/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/scanning/ResteasyReactiveParamConverterScanner.java +++ b/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/scanning/ResteasyReactiveParamConverterScanner.java @@ -46,7 +46,7 @@ public static ParamConverterProviders scanForParamConverters(IndexView index, Ap for (ClassInfo converterClass : paramConverterProviders) { ApplicationScanningResult.KeepProviderResult keepProviderResult = result.keepProvider(converterClass); if (keepProviderResult != ApplicationScanningResult.KeepProviderResult.DISCARD) { - AnnotationInstance priorityInstance = converterClass.classAnnotation(ResteasyReactiveDotNames.PRIORITY); + AnnotationInstance priorityInstance = converterClass.declaredAnnotation(ResteasyReactiveDotNames.PRIORITY); int priority = priorityInstance != null ? priorityInstance.value().asInt() : Priorities.USER; ResourceParamConverterProvider provider = new ResourceParamConverterProvider(); provider.setPriority(priority);