public < T extends BaseProxy > T editProxy ( final T object ) { AutoBean < T > bean = this . checkStreamsNotCrossed ( object ) ; this . checkLocked ( ) ; @ SuppressWarnings ( "unchecked" ) final AutoBean < T > previouslySeen = ( AutoBean < T > ) this . state . editedProxies . get ( BaseProxyCategory . stableId ( bean ) ) ; if ( previouslySeen != null && ! previouslySeen . isFrozen ( ) ) { /* * If we've seen the object before, it might be because it was passed in as a method argument. * This does not guarantee its mutability, so check that here before returning the cached * object. */ return previouslySeen . as ( ) ; } // Create editable copies final AutoBean < T > parent = bean ; bean = this . cloneBeanAndCollections ( bean ) ; bean . setTag ( Constants . PARENT_OBJECT , parent ) ; return bean . as ( ) ; }
Take ownership of a proxy instance and make it editable .