Never return null from AnnotationMetadata.getMetaAnnotationTypes

Issue: SPR-17046
This commit is contained in:
Juergen Hoeller 2018-07-16 18:05:10 +02:00
parent 5fb4982026
commit cacd14c805
1 changed files with 4 additions and 2 deletions

View File

@ -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<String> getMetaAnnotationTypes(String annotationName) {
return this.metaAnnotationMap.get(annotationName);
Set<String> metaAnnotationTypes = this.metaAnnotationMap.get(annotationName);
return (metaAnnotationTypes != null ? metaAnnotationTypes : Collections.emptySet());
}
@Override