private String [ ] getAlternateNames ( String name ) { String oldName , altNames [ ] = null ; DeprecatedKeyInfo keyInfo = deprecatedKeyMap . get ( name ) ; if ( keyInfo == null ) { altNames = ( reverseDeprecatedKeyMap . get ( name ) != null ) ? new String [ ] { reverseDeprecatedKeyMap . get ( name ) } : null ; if ( altNames != null && altNames . length > 0 ) { //To help look for other new configs for this deprecated config keyInfo = deprecatedKeyMap . get ( altNames [ 0 ] ) ; } } if ( keyInfo != null && keyInfo . newKeys . length > 0 ) { List < String > list = new ArrayList < String > ( ) ; if ( altNames != null ) { list . addAll ( Arrays . asList ( altNames ) ) ; } list . addAll ( Arrays . asList ( keyInfo . newKeys ) ) ; altNames = list . toArray ( new String [ list . size ( ) ] ) ; } return altNames ; }
Returns the alternate name for a key if the property name is deprecated or if deprecates a property name .