bito-code-review[bot] commented on PR #15824:
URL: https://github.com/apache/grails-core/pull/15824#issuecomment-4883294747
<!-- Bito Reply -->
The suggested change is correct and aligns with the goal of avoiding
unnecessary initialization of Spring XML infrastructure in the error path. By
using `beanBuildResource` directly when constructing the `Location` object, you
bypass the need to call `getXmlSupport().getReaderContext(beanBuildResource)`,
which would otherwise trigger the lazy initialization of the
`XmlBeanDefinitionReader` and the associated `ApplicationContext`.
This change effectively prevents the potential masking of the "No namespace
handler found" error and improves performance in the exception path.
**grails-spring/src/main/groovy/grails/spring/BeanBuilder.java**
```
final NamespaceHandler namespaceHandler =
getXmlSupport().resolveNamespaceHandler(uri);
if (namespaceHandler == null) {
throw new BeanDefinitionParsingException(
new Problem("No namespace handler found for URI: " +
uri,
new Location(beanBuildResource)));
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]