CPD Results

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

Duplications

File Line
org/apache/maven/plugin/coreit/ForkGoalAggregatorMojo.java 34
org/apache/maven/plugin/coreit/ForkLifecycleAggregatorMojo.java 34
    extends AbstractMojo
{
    /**
     * @parameter default-value="${project}"
     */
    private MavenProject project;

    /**
     * @parameter default-value="${reactorProjects}"
     */
    private List reactorProjects;

    public void execute()
        throws MojoExecutionException
    {
        for ( Object reactorProject : reactorProjects )
        {
            MavenProject executedProject = ( (MavenProject) reactorProject ).getExecutionProject();

            if ( !executedProject.getBuild().getFinalName().equals( TouchMojo.FINAL_NAME ) )
            {
                throw new MojoExecutionException(
                    "Unexpected result, final name of executed project " + executedProject + " is "
                        + executedProject.getBuild().getFinalName() + " (should be \'" + TouchMojo.FINAL_NAME
                        + "\')." );
            }
        }

        if ( project.getBuild().getFinalName().equals( TouchMojo.FINAL_NAME ) )
        {
            throw new MojoExecutionException(
                "forked project was polluted. (should NOT be \'" + TouchMojo.FINAL_NAME + "\')." );
        }
    }
}