Selective backport of annotation retrieval refinements (from 5.0.5)

In particular AnnotationTypeFilter's ignoring of standard Java interfaces, AnnotationUtils.clearCache() and a few extra common classes in ClassUtils.

Issue: SPR-16667
Issue: SPR-16675
This commit is contained in:
Juergen Hoeller
2018-03-31 17:03:59 +02:00
parent 1cbc353dd1
commit 5d54adfb9a
9 changed files with 173 additions and 177 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.
@@ -417,7 +417,8 @@ class ConfigurationClassEnhancer {
@Override
public boolean isMatch(Method candidateMethod) {
return BeanAnnotationHelper.isBeanAnnotated(candidateMethod);
return (candidateMethod.getDeclaringClass() != Object.class &&
BeanAnnotationHelper.isBeanAnnotated(candidateMethod));
}
private ConfigurableBeanFactory getBeanFactory(Object enhancedConfigInstance) {