public void setObject( final Object object ) {
this.object = object;
this.objectHashCode = ( object != null ) ? object.hashCode() : 0;
if ( isTraitOrTraitable() ) {
TraitTypeEnum newType = determineTraitType();
if ( ! ( this.traitType == TraitTypeEnum.LEGACY_TRAITABLE && newType != TraitTypeEnum.LEGACY_TRAITABLE ) ) {
this.identityHashCode = determineIdentityHashCode( object );
} else {
// we are replacing a non-traitable object with its proxy, so we need to preserve the identity hashcode
}