public static void setMetaClass ( GroovyObject self , MetaClass metaClass ) { // this method was introduced as to prevent from a stack overflow, described in GROOVY-5285 if ( metaClass instanceof HandleMetaClass ) metaClass = ( ( HandleMetaClass ) metaClass ) . getAdaptee ( ) ; self . setMetaClass ( metaClass ) ; disablePrimitiveOptimization ( self ) ; }
Set the metaclass for a GroovyObject .