bito-code-review[bot] commented on PR #16034:
URL: https://github.com/apache/grails-core/pull/16034#issuecomment-5039476159
<!-- Bito Reply -->
The test case "property lookups for two same-named ClassNodes in different
packages do not corrupt each other" currently uses different fully-qualified
names ('org.example.one.Widget' and 'org.example.two.Widget'). To better
exercise the regression mechanism and ensure the fix works for same-named
classes, you should update this test to use the same fully-qualified name for
both `ClassNode` instances. This will confirm that the `IdentityHashMap`
correctly distinguishes between distinct instances that share the same name.
**grails-datamapping-core/src/test/groovy/org/grails/datastore/gorm/transform/AstPropertyResolveUtilsSpec.groovy**
```
given: 'two distinct ClassNodes with the same simple name declared in
different packages'
ClassNode first = new ClassNode('org.example.Widget',
Modifier.PUBLIC, ClassHelper.OBJECT_TYPE)
first.addProperty('color', Modifier.PUBLIC, ClassHelper.STRING_TYPE,
null, null, null)
ClassNode second = new ClassNode('org.example.Widget',
Modifier.PUBLIC, ClassHelper.OBJECT_TYPE)
second.addProperty('weight', Modifier.PUBLIC,
ClassHelper.Integer_TYPE, null, null, null)
```
--
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]