Skip to content

Commit 88049e9

Browse files
committed
EventListenerMethodProcessor skips annotation search on java classes
Closes gh-22564
1 parent db56d34 commit 88049e9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

spring-context/src/main/java/org/springframework/context/event/EventListenerMethodProcessor.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -142,7 +142,10 @@ public void afterSingletonsInstantiated() {
142142
}
143143

144144
private void processBean(final String beanName, final Class<?> targetType) {
145-
if (!this.nonAnnotatedClasses.contains(targetType) && !isSpringContainerClass(targetType)) {
145+
if (!this.nonAnnotatedClasses.contains(targetType) &&
146+
!targetType.getName().startsWith("java") &&
147+
!isSpringContainerClass(targetType)) {
148+
146149
Map<Method, EventListener> annotatedMethods = null;
147150
try {
148151
annotatedMethods = MethodIntrospector.selectMethods(targetType,
@@ -155,6 +158,7 @@ private void processBean(final String beanName, final Class<?> targetType) {
155158
logger.debug("Could not resolve methods for bean with name '" + beanName + "'", ex);
156159
}
157160
}
161+
158162
if (CollectionUtils.isEmpty(annotatedMethods)) {
159163
this.nonAnnotatedClasses.add(targetType);
160164
if (logger.isTraceEnabled()) {

0 commit comments

Comments
 (0)