CPD Results

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

Duplications

File Line
org/sonatype/flexmojos/configGenerator/ApplicationFlexConfigGeneratorMojo.java 37
org/sonatype/flexmojos/configGenerator/LibraryFlexConfigGeneratorMojo.java 37
    protected void build( Library builder, boolean printConfigurations )
        throws MojoExecutionException
    {
        // we need open issue "feature request", but currently we use workaround
        if ( configuration instanceof OEMConfiguration )
        {
            FlexConfigBuilder configBuilder = createFlexConfigBuilderWithoutBuild( configuration );
            fixConfigReport( configBuilder );

            File fileReport = getReportFile( REPORT_CONFIG );
            try
            {
                configBuilder.write( fileReport );
            }
            catch ( IOException e )
            {
                throw new MojoExecutionException( "An error has ocurried while recording config-report" );
            }
        }
        else
        {
            throw new MojoExecutionException( "Flex-compiler API change, unable to use suggested \"solution\"!" );
        }
    }

    @Override
    protected void writeLinkReport( Report report )
        throws MojoExecutionException
    {
        projectHelper.attachArtifact( project, "xml", FlexClassifier.LINK_REPORT, getReportFile( REPORT_LINK ) );
    }

    @Override
    protected void writeReport( Report report, String type )
        throws MojoExecutionException
    {

    }

    @Override
    protected void configure()
        throws MojoExecutionException, MojoFailureException
    {
        configurationReport = true;

        super.configure();
    }

    @Override
    protected void writeResourceBundle( Report report )
        throws MojoExecutionException
    {
        for ( String locale : runtimeLocales )
        {
            File localePath = MavenUtils.getLocaleResourcePath( resourceBundlePath, locale );
            writeResourceBundle( null, locale, localePath );
        }
    }

    @Override
    protected void writeResourceBundle( String[] bundlesNames, String locale, File localePath )
        throws MojoExecutionException
    {
        FlexConfigBuilder configBuilder =
            createFlexConfigBuilderWithoutBuild( getResourceBundleConfiguration( locale, localePath ) );