codeconsole commented on PR #16414:
URL: https://github.com/apache/grails-core/pull/16414#issuecomment-6218586990

   @matrei thanks, good catch. The body alone can't show the laziness, so I 
added it in 1d3bf77306.
   
   `JsonMapperConverterSpec` has a second feature based on your probe. It loads 
the `Shipment` in a new session, reads `shipment.@carrier`, renders the 
shipment `as JSON`, and checks:
   - the carrier is a `HibernateProxy`,
   - it is uninitialized before rendering, so the check after rendering means 
something,
   - the JSON is the same reference text as the request feature,
   - it is still uninitialized after rendering.
   
   To check that the assertion can fail, I made 
`DomainClassRendering.referenceId` unwrap the proxy first, which initializes 
it. The new feature then failed on `!Hibernate.isInitialized(carrier)`, while 
the body-only feature still passed. I reverted the change and the spec passes 
again.
   
   The branch also has a merge of the latest 9.0.x (4e69821b89). Its only 
conflict was the upgrade guide: the new invokedynamic section is §2, so the 
`grails.converters.JSON` and domain Jackson sections are now §3 and §4, with 
their text unchanged. On the merge, `grails-converters` (413), 
`grails-web-common` (144), `codeStyle` and `JsonMapperConverterSpec` pass.
   


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