Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Don't use Exception for normal behavior in org.springframework.core.annotation.AnnotationUtils.getValue [SPR-12604] #17205
If annotation is null this method throws a NullPointerException and catches it to return null. This method is called frequently with annotation==null - at least in my case (using spring-data to findById)
Please rewrite it to:
here is the end of the corresponding stack:
Juergen Hoeller commented
Hmm, that method isn't really meant to be called with a null annotation reference to begin with... I'd recommend a not-null check in the corresponding Spring Data code.
That said, it doesn't hurt to defensively check for null in AnnotationUtils itself either. I'll revise it for 4.1.5.