private Properties inheritProperties ( final Properties parentProps , final Properties childProps ) { if ( parentProps == null ) { return childProps ; } if ( childProps == null ) { return parentProps ; } for ( final String parentKey : parentProps . stringPropertyNames ( ) ) { // Add the parent property to the child if the child does not // already define it if ( ! childProps . containsKey ( parentKey ) ) { childProps . setProperty ( parentKey , parentProps . getProperty ( parentKey ) ) ; } } return childProps ; }
Merge the parent properties that are already set into the child properties . Child properties always override parent values .