From 0df836825a14ba4190d79a847e9f2349da9c3f91 Mon Sep 17 00:00:00 2001 From: Matej Novotny Date: Wed, 8 Feb 2023 06:49:52 +0100 Subject: [PATCH] Metrics - check if index contains class before attempting to use it (cherry picked from commit 3cb61b796b06df8971d10915163c34376a338ba6) --- .../metrics/deployment/jandex/JandexBeanInfoAdapter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/smallrye-metrics/deployment/src/main/java/io/quarkus/smallrye/metrics/deployment/jandex/JandexBeanInfoAdapter.java b/extensions/smallrye-metrics/deployment/src/main/java/io/quarkus/smallrye/metrics/deployment/jandex/JandexBeanInfoAdapter.java index 0b4ff51813a1d..e33ffaf1142a6 100644 --- a/extensions/smallrye-metrics/deployment/src/main/java/io/quarkus/smallrye/metrics/deployment/jandex/JandexBeanInfoAdapter.java +++ b/extensions/smallrye-metrics/deployment/src/main/java/io/quarkus/smallrye/metrics/deployment/jandex/JandexBeanInfoAdapter.java @@ -68,7 +68,7 @@ public BeanInfo convert(ClassInfo input) { private Stream getMetricAnnotationsThroughStereotype(AnnotationInstance stereotypeInstance, IndexView indexView) { ClassInfo annotationType = indexView.getClassByName(stereotypeInstance.name()); - if (annotationType.classAnnotation(DotNames.STEREOTYPE) != null) { + if (annotationType != null && annotationType.declaredAnnotation(DotNames.STEREOTYPE) != null) { JandexAnnotationInfoAdapter adapter = new JandexAnnotationInfoAdapter(indexView); return transformedAnnotations.getAnnotations(annotationType) .stream()