Map dominantReportSetsById = dominant.getReportSetsAsMap();
for ( Iterator it = recessive.getReportSets().iterator(); it.hasNext(); )
{
ReportSet recessiveReportSet = (ReportSet) it.next();
ReportSet dominantReportSet = (ReportSet) dominantReportSetsById.get( recessiveReportSet.getId() );
ReportSet merged = recessiveReportSet;
if ( dominantReportSet != null )
{
merged = recessiveReportSet;
Xpp3Dom dominantRSConfig = (Xpp3Dom) dominantReportSet.getConfiguration();
Xpp3Dom mergedRSConfig = (Xpp3Dom) merged.getConfiguration();
merged.setConfiguration( merge( dominantRSConfig, mergedRSConfig ) );
List mergedReports = merged.getReports();
if ( mergedReports == null )
{
mergedReports = new ArrayList();
merged.setReports( mergedReports );
}
List dominantRSReports = dominantReportSet.getReports();
if ( dominantRSReports != null )
{
for ( Iterator reportIterator = dominantRSReports.iterator(); reportIterator.hasNext(); )
{
String report = (String) reportIterator.next();
if ( !mergedReports.contains( report ) )
{
mergedReports.add( report );
}
}
}
mergedReportSets.put( merged.getId(), merged );
}
}
for ( Iterator rsIterator = dominantReportSetsById.entrySet().iterator(); rsIterator.hasNext(); )
{