CPD Results

The following document contains the results of PMD's CPD 5.0.5.

Duplications

File Line
org/apache/maven/model/merge/ModelMerger.java 556
org/apache/maven/model/merge/ModelMerger.java 1457
org/apache/maven/model/merge/ModelMerger.java 2577
    protected void mergeModelBase_Dependencies( ModelBase target, ModelBase source, boolean sourceDominant,
                                                Map<Object, Object> context )
    {
        List<Dependency> src = source.getDependencies();
        if ( !src.isEmpty() )
        {
            List<Dependency> tgt = target.getDependencies();
            Map<Object, Dependency> merged = new LinkedHashMap<Object, Dependency>( ( src.size() + tgt.size() ) * 2 );

            for ( Dependency element : tgt )
            {
                Object key = getDependencyKey( element );
                merged.put( key, element );
            }

            for ( Dependency element : src )
            {
                Object key = getDependencyKey( element );
                if ( sourceDominant || !merged.containsKey( key ) )
                {
                    merged.put( key, element );
                }
            }

            target.setDependencies( new ArrayList<Dependency>( merged.values() ) );
        }
    }

    protected void mergeModelBase_Repositories( ModelBase target, ModelBase source, boolean sourceDominant,
File Line
org/apache/maven/model/merge/ModelMerger.java 688
org/apache/maven/model/merge/ModelMerger.java 1874
    protected void mergeModelBase_Properties( ModelBase target, ModelBase source, boolean sourceDominant,
                                              Map<Object, Object> context )
    {
        Properties merged = new Properties();
        if ( sourceDominant )
        {
            merged.putAll( target.getProperties() );
            merged.putAll( source.getProperties() );
        }
        else
        {
            merged.putAll( source.getProperties() );
            merged.putAll( target.getProperties() );
        }
        target.setProperties( merged );
        target.setLocation( "properties", InputLocation.merge( target.getLocation( "properties" ),
                                                               source.getLocation( "properties" ), sourceDominant ) );
    }

    protected void mergeDistributionManagement( DistributionManagement target, DistributionManagement source,