jamesfredley commented on code in PR #16302:
URL: https://github.com/apache/grails-core/pull/16302#discussion_r3920131596


##########
grails-fields/src/test/groovy/grails/plugin/formfields/TemplateLookupCachingSpec.groovy:
##########
@@ -122,4 +122,38 @@ class TemplateLookupCachingSpec extends 
BuildsAccessorFactory implements Service
                1 * mockGroovyPageLocator.findTemplateByPath(_) >> 
templateResource
        }
 
+       @Issue('https://github.com/apache/grails-core/issues/16162')
+       void 'distinct accessors for the same property shape share the cache'() 
{
+               given:
+               def templateResource = new 
GroovyPageResourceScriptSource('/_fields/testBean/stringProperty/_widget.gsp', 
new ByteArrayResource('BEAN PROPERTY TEMPLATE'.getBytes('UTF-8')))
+
+               and:
+               def bean1 = new TestBean(stringProperty: 'Bart Simpson')
+               def bean2 = new TestBean(stringProperty: 'Lisa Simpson')
+               def property1 = beanPropertyAccessorFactory.accessorFor(bean1, 
'stringProperty')
+               def property2 = beanPropertyAccessorFactory.accessorFor(bean2, 
'stringProperty')

Review Comment:
   Valid catch. The regression now uses a local non-domain fixture in this spec 
instead of TestBean from PlainObjectPropertyAccessorSpec.



-- 
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]

Reply via email to