question: private ExtensionMapping migrateExtensionMapping ( ExtensionMapping extensionMapping , Extension newer , Set < ExtensionProperty > deprecated ) { log . debug ( "Migrating extension mapping..." ) ; extensionMapping . setExtension ( newer ) ; for ( ExtensionProperty deprecatedProperty : deprecated ) { Term replacedBy = TERMS_REPLACED_BY_ANOTHER_TERM . get ( deprecatedProperty . qualifiedName ( ) ) ; if ( replacedBy != null && newer . getProperty ( replacedBy ) != null && ! extensionMapping . isMapped ( replacedBy ) ) { PropertyMapping pm = extensionMapping . getField ( deprecatedProperty . qualifiedName ( ) ) ; ExtensionProperty ep = newer . getProperty ( replacedBy ) ; if ( pm != null && ep != null ) { pm . setTerm ( ep ) ; log . debug ( "Mapping to deprecated term " + deprecatedProperty . qualifiedName ( ) + " has been migrated to term " + replacedBy . qualifiedName ( ) ) ; } } else { log . debug ( "Mapping to deprecated term " + deprecatedProperty . qualifiedName ( ) + " cannot be migrated therefore it is being removed!" ) ; removePropertyMapping ( extensionMapping , deprecatedProperty . qualifiedName ( ) ) ; } } return extensionMapping ; }
target:  Migrate an ExtensionMapping to use a newer version of that extension: 1. Migrate property mappings for deprecated terms that have been replaced by another term. Careful, the replacing term must be included in the newer extension version, and cannot already be mapped 2. Remove property mappings for deprecated terms that have NOT been replaced by another term