o Continued work on model merging

git-svn-id: https://svn.apache.org/repos/asf/maven/components/branches/MNG-2766@773019 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-05-08 14:58:26 +00:00
parent 6e2798f2e9
commit 24cf91d858
1 changed files with 7 additions and 7 deletions

View File

@ -468,26 +468,26 @@ public class MavenModelMerger
Map<Object, PluginExecution> merged =
new LinkedHashMap<Object, PluginExecution>( ( src.size() + tgt.size() ) * 2 );
for ( Iterator<PluginExecution> it = tgt.iterator(); it.hasNext(); )
// FIXME: This needs to consider the <inherited> flag. If this is not detected by a UT/IT, we might want to
// create one...
for ( Iterator<PluginExecution> it = src.iterator(); it.hasNext(); )
{
PluginExecution element = it.next();
Object key = getPluginExecutionKey( element );
merged.put( key, element );
}
for ( Iterator<PluginExecution> it = src.iterator(); it.hasNext(); )
for ( Iterator<PluginExecution> it = tgt.iterator(); it.hasNext(); )
{
PluginExecution element = it.next();
Object key = getPluginExecutionKey( element );
PluginExecution existing = merged.get( key );
if ( existing != null )
{
mergePluginExecution( existing, element, sourceDominant, context );
}
else
{
merged.put( key, element );
mergePluginExecution( element, existing, sourceDominant, context );
}
merged.put( key, element );
}
target.setExecutions( new ArrayList<PluginExecution>( merged.values() ) );