You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@grails.apache.org by bo...@apache.org on 2026/10/06 23:07:43 UTC
(grails-core) 08/11: fix: read the mapping context field, not its proxying getter, in DefaultGrailsApplication's placeholder
This is an automated email from the ASF dual-hosted git repository.
borinquenkid pushed a commit to branch 9.0.x-h7-improvement-phase3
in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit 2b22e94cd0d89dadbd5b76a3fb592ea0c3c0b849
Author: Walter Duque de Estrada <wb...@mac.com>
AuthorDate: Tue Oct 6 16:48:47 2026 -0500
fix: read the mapping context field, not its proxying getter, in DefaultGrailsApplication's placeholder
The Java-to-Groovy conversion turned application.mappingContext in the static
placeholder proxy handler into a call of getMappingContext(), which answers the
placeholder itself while no context is set, so any call on the placeholder
recursed until StackOverflowError instead of throwing the 'cannot be accessed
before GORM has initialized' GrailsConfigurationException. Found by the new
upstream DataBindingUtilsSpec feature 'test binding before GORM has initialized
the mapping context'; the field is read with .@ as before the conversion.
Co-Authored-By: Claude Sonnet 5.5 <no...@anthropic.com>
---
grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.groovy | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.groovy b/grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.groovy
index ccf973a8c5..52ee1ec657 100644
--- a/grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.groovy
+++ b/grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.groovy
@@ -101,7 +101,7 @@ class DefaultGrailsApplication extends AbstractGrailsApplication implements Bean
InvocationHandler proxyHandler = new InvocationHandler() {
@Override
Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
- MappingContext realContext = application.mappingContext
+ MappingContext realContext = application.@mappingContext
if (realContext == null) {
throw new GrailsConfigurationException('The method [' + method + '] cannot be accessed before GORM has initialized')
}