private static Dictionary < String , Object > massageNewConfig ( Dictionary < String , Object > oldProps , Dictionary < String , Object > newProps ) { ConfigurationDictionary ret = new ConfigurationDictionary ( ) ; if ( oldProps != null ) { for ( Enumeration < String > keyItr = oldProps . keys ( ) ; keyItr . hasMoreElements ( ) ; ) { String key = keyItr . nextElement ( ) ; if ( ( ( key . startsWith ( XMLConfigConstants . CFG_CONFIG_PREFIX ) && ! ( key . equals ( XMLConfigConstants . CFG_PARENT_PID ) ) ) || key . startsWith ( XMLConfigConstants . CFG_SERVICE_PREFIX ) ) ) { ret . put ( key , oldProps . get ( key ) ) ; } } } if ( newProps != null ) { for ( Enumeration < String > keyItr = newProps . keys ( ) ; keyItr . hasMoreElements ( ) ; ) { String key = keyItr . nextElement ( ) ; ret . put ( key , newProps . get ( key ) ) ; } } if ( ret . isEmpty ( ) ) { ret = null ; } else { // must add config.source, else things may not process properly ret . put ( XMLConfigConstants . CFG_CONFIG_SOURCE , XMLConfigConstants . CFG_CONFIG_SOURCE_FILE ) ; } return ret ; }
Return a new config dictionary with initial hidden keys and values from o then add all keys and values from n to the new config dictionary and return . If returning dictionary is empty return null instead .