From 6348f5c71a7906bbda3a3d386d770a058ef883c4 Mon Sep 17 00:00:00 2001 From: Foivos Zakkak Date: Mon, 20 Jun 2022 13:39:25 +0300 Subject: [PATCH] Avoid NPEs in includeAnnotation when annotationValue is null Fixes issue introduced by https://github.com/oracle/graal/pull/4614 --- .../com/oracle/svm/reflect/hosted/ReflectionDataBuilder.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/ReflectionDataBuilder.java b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/ReflectionDataBuilder.java index 386096c667d3..59560be09d81 100644 --- a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/ReflectionDataBuilder.java +++ b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/ReflectionDataBuilder.java @@ -608,6 +608,9 @@ private void registerTypesForAnnotationDefault(DuringAnalysisAccessImpl access, } private static boolean includeAnnotation(DuringAnalysisAccessImpl access, AnnotationValue annotationValue) { + if (annotationValue == null) { + return false; + } for (Class type : annotationValue.getTypes()) { if (type == null || SubstitutionReflectivityFilter.shouldExclude(type, access.getMetaAccess(), access.getUniverse())) { return false;