private void setProperties ( Dictionary < String , ? > d ) { if ( d == null ) { this . properties = null ; return ; } ConfigurationDictionary newDictionary = new ConfigurationDictionary ( ) ; Enumeration < String > keys = d . keys ( ) ; while ( keys . hasMoreElements ( ) ) { String key = keys . nextElement ( ) ; if ( newDictionary . get ( key ) == null ) { Object value = d . get ( key ) ; if ( value . getClass ( ) . isArray ( ) ) { int arrayLength = Array . getLength ( value ) ; Object copyOfArray = Array . newInstance ( value . getClass ( ) . getComponentType ( ) , arrayLength ) ; System . arraycopy ( value , 0 , copyOfArray , 0 , arrayLength ) ; newDictionary . put ( key , copyOfArray ) ; } else if ( value instanceof Collection ) { newDictionary . put ( key , new Vector < Object > ( ( Collection < ? > ) value ) ) ; } else { newDictionary . put ( key , value ) ; } } else throw new IllegalArgumentException ( key + " is already present or is a case variant." ) ; //$NON-NLS-1$ } // fill in necessary properties if ( this . factoryPid != null ) { newDictionary . put ( ConfigurationAdmin . SERVICE_FACTORYPID , this . factoryPid ) ; } newDictionary . put ( Constants . SERVICE_PID , this . pid ) ; if ( this . inOverridesFile ) { newDictionary . put ( "config.overrides" , "true" ) ; } this . properties = newDictionary ; //we got new props so we should redo the mappings in case they changed addPidMapping ( ) ; }
This is not part of Configuration interface . It sets configuration dictionary with specified dictionary and updates configuration attributes if they are not set and found in given dictionary .