Never return null from AnnotationMetadata.getMetaAnnotationTypes

Issue: SPR-17046
master
Juergen Hoeller 6 years ago
parent 5fb4982026
commit cacd14c805
  1. 6
      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<String> getMetaAnnotationTypes(String annotationName) {
return this.metaAnnotationMap.get(annotationName);
Set<String> metaAnnotationTypes = this.metaAnnotationMap.get(annotationName);
return (metaAnnotationTypes != null ? metaAnnotationTypes : Collections.emptySet());
}
@Override

Loading…
Cancel
Save