CPD Results

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

Duplications

File Line
org/jomc/tools/JavaClasses.java 282
org/jomc/tools/JavaClasses.java 721
        {
            Dependencies dependencies = this.getModules().getDependencies( implementation.getIdentifier() );
            if ( dependencies == null )
            {
                dependencies = new Dependencies();
            }

            Properties properties = this.getModules().getProperties( implementation.getIdentifier() );
            if ( properties == null )
            {
                properties = new Properties();
            }

            Messages messages = this.getModules().getMessages( implementation.getIdentifier() );
            if ( messages == null )
            {
                messages = new Messages();
            }

            Specifications specifications = this.getModules().getSpecifications( implementation.getIdentifier() );
            if ( specifications == null )
            {
                specifications = new Specifications();
            }

File Line
org/jomc/tools/JavaSources.java 290
org/jomc/tools/JavaSources.java 458
                }

                if ( !edited.equals( content ) )
                {
                    if ( !f.getParentFile().exists() && !f.getParentFile().mkdirs() )
                    {
                        throw new ToolException( getMessage( "failedCreatingDirectory",
                                                             f.getParentFile().getAbsolutePath() ) );

                    }

                    if ( this.isLoggable( Level.INFO ) )
                    {
                        this.log( Level.INFO, getMessage( "editing", f.getCanonicalPath() ), null );
                    }

                    FileUtils.writeStringToFile( f, edited, this.getOutputEncoding() );
                }
            }
        }
        catch ( final IOException e )
        {
            throw new ToolException( e );
        }
    }

    /**
     * Gets a new editor for editing Java specification source code.
     *
     * @param specification The specification to create a new editor for.
     *
     * @return A new editor for editing the source code of {@code specification}.
     *
     * @throws NullPointerException if {@code specification} is {@code null}.
     */
    public JavaSpecificationEditor getSpecificationEditor( final Specification specification )

File Line
org/jomc/tools/JavaSources.java 260
org/jomc/tools/JavaSources.java 347
                final JavaImplementationEditor editor = this.getImplementationEditor( implementation );
                final String edited;
                try
                {
                    edited = editor.edit( content );
                }
                catch ( final IOException e )
                {
                    throw new ToolException( getMessage( "failedEditing", f.getCanonicalPath(), e.getMessage() ), e );
                }

                if ( !editor.isLicenseSectionPresent() && this.isLoggable( Level.INFO ) )
                {
                    this.log( Level.INFO, getMessage( "missingOptionalSection", LICENSE_SECTION_NAME,
                                                      f.getCanonicalPath() ), null );

                }

                if ( !editor.isAnnotationsSectionPresent() )
                {
                    throw new ToolException( getMessage( "missingSection", ANNOTATIONS_SECTION_NAME,