private SiteConfiguration mergeConfigurations(SiteConfiguration rootConf, SiteConfiguration controllerConf) {
        // do not do any overwrites to the rootConf
        // clone it instead (or create an entirely new object)
        SiteConfiguration topConf = rootConf.clone();
        if (controllerConf.title != null && !controllerConf.title.isEmpty()) topConf.title = controllerConf.title;
        
        if (controllerConf.scripts != null) {
            if (topConf.scripts != null) {
                SiteConfiguration.Tag[] scripts = new SiteConfiguration.Tag[topConf.scripts.length + controllerConf.scripts.length];
                System.arraycopy(topConf.scripts, 0, scripts, 0, topConf.scripts.length);
                System.arraycopy(controllerConf.scripts, 0, scripts, topConf.scripts.length, controllerConf.scripts.length);
                topConf.scripts = scripts;
            } else {
                topConf.scripts = Arrays.copyOf(controllerConf.scripts, controllerConf.scripts.length);
            }
        }
        
        if (controllerConf.styles != null) {
            if (topConf.styles != null) {
            	SiteConfiguration.Tag[] styles = new SiteConfiguration.Tag[topConf.styles.length + controllerConf.styles.length];
                System.arraycopy(topConf.styles, 0, styles, 0, topConf.styles.length);
                System.arraycopy(controllerConf.styles, 0, styles, topConf.styles.length, controllerConf.styles.length);
                topConf.styles = styles;
            } else {
                topConf.styles = Arrays.copyOf(controllerConf.styles, controllerConf.styles.length);
            }
        }
        
        return topConf;
    }
private SiteConfiguration mergeConfigurations ( SiteConfiguration rootConf , SiteConfiguration controllerConf ) { SiteConfiguration topConf = rootConf . clone ( ) ; if ( controllerConf . title != null && ! controllerConf . title . isEmpty ( ) ) topConf . title = controllerConf . title ; if ( controllerConf . scripts != null ) { if ( topConf . scripts != null ) { SiteConfiguration . Tag [ ] scripts = new SiteConfiguration . Tag [ topConf . scripts . length + controllerConf . scripts . length ] ; System . arraycopy ( topConf . scripts , 0 , scripts , 0 , topConf . scripts . length ) ; System . arraycopy ( controllerConf . scripts , 0 , scripts , topConf . scripts . length , controllerConf . scripts . length ) ; topConf . scripts = scripts ; } else { topConf . scripts = Arrays . copyOf ( controllerConf . scripts , controllerConf . scripts . length ) ; } } if ( controllerConf . styles != null ) { if ( topConf . styles != null ) { SiteConfiguration . Tag [ ] styles = new SiteConfiguration . Tag [ topConf . styles . length + controllerConf . styles . length ] ; System . arraycopy ( topConf . styles , 0 , styles , 0 , topConf . styles . length ) ; System . arraycopy ( controllerConf . styles , 0 , styles , topConf . styles . length , controllerConf . styles . length ) ; topConf . styles = styles ; } else { topConf . styles = Arrays . copyOf ( controllerConf . styles , controllerConf . styles . length ) ; } } return topConf ; }
Letting <code>controllerConf</code> take precedence over <code>rootConf</code>.
<br>Adding them uncritically

<p>Does not do any overwrites on any of the parameters.
Instead it creates a new object with all the merges

@param rootConf
The default configuration at the root of the templateFolder
@param controllerConf
The controller configuration - might be empty, if no {@value #SITE_FILE} is found within the controller path
@return The merged SiteConfiguration