diff --git a/spring-core/src/main/java/org/springframework/core/type/classreading/AnnotationMetadataReadingVisitor.java b/spring-core/src/main/java/org/springframework/core/type/classreading/AnnotationMetadataReadingVisitor.java index b66a826541..a24d3b2289 100644 --- a/spring-core/src/main/java/org/springframework/core/type/classreading/AnnotationMetadataReadingVisitor.java +++ b/spring-core/src/main/java/org/springframework/core/type/classreading/AnnotationMetadataReadingVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ package org.springframework.core.type.classreading; import java.util.Collection; +import java.util.Collections; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; @@ -98,7 +99,8 @@ public class AnnotationMetadataReadingVisitor extends ClassMetadataReadingVisito @Override public Set getMetaAnnotationTypes(String annotationName) { - return this.metaAnnotationMap.get(annotationName); + Set metaAnnotationTypes = this.metaAnnotationMap.get(annotationName); + return (metaAnnotationTypes != null ? metaAnnotationTypes : Collections.emptySet()); } @Override