if ( releases != null )
{
for ( Iterator iterator = releases.iterator(); iterator.hasNext(); )
{
final Release release = (Release) iterator.next();
final Release componentRelease = getRelease( componentReleases, release.getVersion() );
if ( componentRelease != null ) {
release.addComponent( componentName, componentRelease );
}
mergedReleases.add( release );
}
}
for ( Iterator iterator = componentReleases.iterator(); iterator.hasNext(); )
{
final Release release = (Release) iterator.next();
final Release mergedRelease = getRelease( mergedReleases, release.getVersion() );
if ( mergedRelease == null )
{
final Release componentRelease = new Release();
componentRelease.setVersion( release.getVersion() );
componentRelease.setDateRelease( release.getDateRelease() );
componentRelease.addComponent( componentName, release );
mergedReleases.add( componentRelease );
}
}
return mergedReleases;