@ SuppressWarnings ( "unchecked" ) private List < RaConfigProperty > mergeConfigProperties ( List < RaConfigProperty > rxConfigProperties , List < RaConfigProperty > annotatedConfigProperties ) { final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; LinkedList < RaConfigProperty > configProperties = new LinkedList < RaConfigProperty > ( ) ; List < RaConfigProperty > annoConfigProperties = null ; if ( annotatedConfigProperties != null ) annoConfigProperties = ( List < RaConfigProperty > ) ( ( LinkedList < RaConfigProperty > ) annotatedConfigProperties ) . clone ( ) ; else annoConfigProperties = new LinkedList < RaConfigProperty > ( ) ; if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "rxConfigProperties size: " + rxConfigProperties . size ( ) ) ; for ( RaConfigProperty rxConfigProp : rxConfigProperties ) { RaConfigProperty annoConfigProp = null ; if ( annoConfigProperties . isEmpty ( ) ) { return ( List < RaConfigProperty > ) ( ( LinkedList < RaConfigProperty > ) rxConfigProperties ) . clone ( ) ; } else { for ( RaConfigProperty configProp : annoConfigProperties ) if ( isEqual ( rxConfigProp . getName ( ) , configProp . getName ( ) ) ) { annoConfigProp = configProp ; break ; } if ( annoConfigProp != null ) { if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "merging " + rxConfigProp + ", " + annoConfigProp ) ; // remove the config property from the list so we know at the end if there // are any additional annotated-only config properties that we need to copy // into the master annoConfigProperties . remove ( annoConfigProp ) ; // merge the two config properties if ( rxConfigProp . getConfidential ( ) == null ) rxConfigProp . setConfidential ( annoConfigProp . getConfidential ( ) ) ; if ( rxConfigProp . getDescription ( ) == null || rxConfigProp . getDescription ( ) . isEmpty ( ) ) rxConfigProp . setDescription ( annoConfigProp . getDescription ( ) ) ; if ( rxConfigProp . getIgnore ( ) == null ) rxConfigProp . setIgnore ( annoConfigProp . getIgnore ( ) ) ; if ( rxConfigProp . getSupportsDynamicUpdates ( ) == null ) rxConfigProp . setSupportsDynamicUpdates ( annoConfigProp . getSupportsDynamicUpdates ( ) ) ; if ( rxConfigProp . getType ( ) == null || rxConfigProp . getType ( ) . equals ( "" ) ) rxConfigProp . setType ( annoConfigProp . getType ( ) ) ; if ( rxConfigProp . getDefault ( ) == null || rxConfigProp . getDefault ( ) . equals ( "" ) ) rxConfigProp . setDefault ( annoConfigProp . getDefault ( ) ) ; configProperties . add ( rxConfigProp ) ; } else { configProperties . add ( rxConfigProp ) ; } } } if ( ! annoConfigProperties . isEmpty ( ) ) { // there are annotated config properties that do not exist already in the ra.xml, // thus add them to the master for ( RaConfigProperty configProp : annoConfigProperties ) configProperties . ( configProp ) ; } return configProperties ; }
Merge config properties