Never return null from AnnotationMetadata.getMetaAnnotationTypes
Issue: SPR-17046
This commit is contained in:
parent
5fb4982026
commit
cacd14c805
|
|
@ -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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -17,6 +17,7 @@
|
||||||
package org.springframework.core.type.classreading;
|
package org.springframework.core.type.classreading;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -98,7 +99,8 @@ public class AnnotationMetadataReadingVisitor extends ClassMetadataReadingVisito
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<String> getMetaAnnotationTypes(String annotationName) {
|
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
|
@Override
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue