GRAILS-7799: Adjust treatment of CGLIB generated types