SpringSource/spring-framework — pull request #81 by JanecekPetr (2012-05-16 20:28:46+00:00)
Title: Fix annotation search ending too early

At AnnotationUtils.findAnnotation(Method, Class), the search for method
annotation fails if:

- the original method does not have the annotation

- an abstract superclass does not have an equivalent method declared

- an interface implemented by the superclass has the method and
the annotation - it is not found

This happened because of the try-catch block being too wide. Therefore,
cl.getDeclaredMethod() can throw NoSuchMethodException and skip
the searchOnInterfaces() call prematurely.

The try-catch block was made narrower to allow searchOnInterfaces()
to run even if the abstract class does not have the method declared
at all.

Issue: SPR-9342

I have signed and agree to the terms of the SpringSource Individual Contributor License Agreement.