Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnnotationUtils.findAnnotation(Method method) broken for repeatable anns #22702

Closed
garyrussell opened this issue Mar 28, 2019 · 0 comments
Closed
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: regression A bug that is also a regression
Milestone

Comments

@garyrussell
Copy link
Contributor

garyrussell commented Mar 28, 2019

On 5.2.0.BUILD-SNAPSHOT.

Previously...

	private Collection<RabbitListener> findListenerAnnotations(Method method) {
		Set<RabbitListener> listeners = new HashSet<RabbitListener>();
		RabbitListener ann = AnnotationUtils.findAnnotation(method, RabbitListener.class);
		if (ann != null) {
			listeners.add(ann);
		}
		RabbitListeners anns = AnnotationUtils.findAnnotation(method, RabbitListeners.class);
		if (anns != null) {
			Collections.addAll(listeners, anns.value());
		}
		return listeners;
	}

and

	@Component
	static class RabbitListenersBean {

		@RabbitListeners({
				@RabbitListener(id = "first", queues = "myQueue"),
				@RabbitListener(id = "second", queues = "anotherQueue")
		})
		public void repeatableHandle(String msg) {
		}

	}

Returned null for the first call and and found the container for the second call.

With the current snapshot, the first call now returns just the first "child" annotation.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Mar 28, 2019
@philwebb philwebb self-assigned this Mar 28, 2019
@philwebb philwebb added type: bug A general bug type: regression A bug that is also a regression and removed type: bug A general bug status: waiting-for-triage An issue we've not yet triaged or decided on labels Mar 28, 2019
@philwebb philwebb added this to the 5.2 M1 milestone Mar 28, 2019
@philwebb philwebb added the in: core Issues in core modules (aop, beans, core, context, expression) label Mar 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: regression A bug that is also a regression
Projects
None yet
Development

No branches or pull requests

3 participants