CPD Results

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

Duplications

File Line
org\andromda\maven\plugin\modelarchiver\EpxArchiverMojo.java 51
org\andromda\maven\plugin\modelarchiver\Uml2ArchiverMojo.java 51
org\andromda\maven\plugin\modelarchiver\UmlArchiverMojo.java 50
org\andromda\maven\plugin\modelarchiver\UmlLibraryArchiverMojo.java 50
org\andromda\maven\plugin\modelarchiver\UmlProfileArchiverMojo.java 51
            getLog().debug(" ======= EpxArchiverMojo settings =======");
            getLog().debug("modelSourceDirectory[" + modelSourceDirectory + ']');
            getLog().debug("workDirectory[" + workDirectory + ']');
            getLog().debug("outputDirectory[" + outputDirectory + ']');
            getLog().debug("finalName[" + finalName + ']');
            getLog().debug("replaceExtensions[" + replaceExtensions + ']');
        }

        try
        {
            final File buildDirectory = this.workDirectory;
            if (buildDirectory.exists())
            {   // old files in directory are not automatically deleted.
                deleteFiles(buildDirectory.getAbsolutePath(), ARTIFACT_TYPE);
            }
            else
            {
                buildDirectory.mkdirs();
            }

            if (modelSourceDirectory.exists())
            {
                getLog().info("Copy " + ARTIFACT_TYPE + " resources to " + buildDirectory.getAbsolutePath());
                final File[] modelFiles = modelSourceDirectory.listFiles();
                for (final File file : modelFiles)
                {
                    if (file.isFile() && file.toString().matches(this.modelFilePattern))
                    {
                        final File newFile =
                                new File(buildDirectory,
                                        this.finalName + '.' + ARTIFACT_TYPE);
                        FileUtils.copyFile(file, newFile);

                        if (replaceExtensions)
                        {
                            getLog().info("Replace extensions in " + newFile);
                            replaceExtensions(this.replacementExtensions, newFile);
                        }

                        setArtifactFile(newFile);
                    }
                }
            }
        }
        catch (final Throwable throwable)
        {
            throw new MojoExecutionException("Error assembling model", throwable);
        }
    }
}
File Line
org\andromda\maven\plugin\modelarchiver\EmxArchiverMojo.java 51
org\andromda\maven\plugin\modelarchiver\EpxArchiverMojo.java 51
org\andromda\maven\plugin\modelarchiver\Uml2ArchiverMojo.java 51
org\andromda\maven\plugin\modelarchiver\UmlArchiverMojo.java 50
org\andromda\maven\plugin\modelarchiver\UmlLibraryArchiverMojo.java 50
org\andromda\maven\plugin\modelarchiver\UmlProfileArchiverMojo.java 51
            getLog().debug(" ======= EmxArchiverMojo settings =======");
            getLog().debug("modelSourceDirectory[" + modelSourceDirectory + ']');
            getLog().debug("workDirectory[" + workDirectory + ']');
            getLog().debug("outputDirectory[" + outputDirectory + ']');
            getLog().debug("finalName[" + finalName + ']');
            getLog().debug("replaceExtensions[" + replaceExtensions + ']');
        }

        try
        {
            final File buildDirectory = this.workDirectory;
            if (buildDirectory.exists())
            {   // old files in directory are not automatically deleted.
                deleteFiles(buildDirectory.getAbsolutePath(), ARTIFACT_TYPE);
            }
            else
            {
                buildDirectory.mkdirs();
            }

            if (modelSourceDirectory.exists())
            {
File Line
org\andromda\maven\plugin\modelarchiver\EmxArchiverMojo.java 56
org\andromda\maven\plugin\modelarchiver\XmlArchiverMojo.java 47
            getLog().debug("replaceExtensions[" + replaceExtensions + ']');
        }

        try
        {
            final File buildDirectory = this.workDirectory;
            if (buildDirectory.exists())
            {   // old files in directory are not automatically deleted.
                deleteFiles(buildDirectory.getAbsolutePath(), ARTIFACT_TYPE);
            }
            else
            {
                buildDirectory.mkdirs();
            }

            if (modelSourceDirectory.exists())
            {
                final File[] modelFiles = modelSourceDirectory.listFiles();
                for (final File file : modelFiles)
                {
                    if (file.isFile() && file.toString().matches(this.modelFilePattern))
                    {
                        final File newFile =
                                new File(buildDirectory,
                                        this.finalName + '.' + ARTIFACT_TYPE);