private void checkMultiLevelKeys ( final Map < String , KeyDef > keysDefMap , final Map < String , String > keysRefMap ) { String key ; KeyDef value ; // tempMap storing values to avoid ConcurrentModificationException final Map < String , KeyDef > tempMap = new HashMap <> ( ) ; for ( Entry < String , KeyDef > entry : keysDefMap . entrySet ( ) ) { key = entry . getKey ( ) ; value = entry . getValue ( ) ; // there is multi-level keys exist. if ( keysRefMap . containsValue ( key ) ) { // get multi-level keys final List < String > keysList = getKeysList ( key , keysRefMap ) ; for ( final String multikey : keysList ) { // update tempMap tempMap . put ( multikey , value ) ; } } } // update keysDefMap. keysDefMap . putAll ( tempMap ) ; }
Update keysDefMap for multi - level keys