CPD Results

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

Duplications

FileLine
org/apache/maven/plugin/eclipse/writers/rad/RadApplicationXMLWriter.java57
org/apache/maven/plugin/eclipse/writers/wtp/EclipseWtpApplicationXMLWriter.java37
{

    private static final String APPLICATION_XML_APPLICATION = "application";

    private static final String APPLICATION_XML_CONTEXT_ROOT = "context-root";

    private static final String APPLICATION_XML_DESCRIPTION = "description";

    private static final String APPLICATION_XML_DISPLAY_NAME = "display-name";

    private static final String APPLICATION_XML_FILENAME = "application.xml";

    private static final String APPLICATION_XML_MODULE = "module";

    private static final String APPLICATION_XML_WEB = "web";

    private static final String APPLICATION_XML_WEB_URI = "web-uri";

    private static final String HREF = "href";

    private static final String ID = "id";

    private static final String MODULEMAP_EARPROJECT_MAP = "modulemap:EARProjectMap";

    private static final String MODULEMAPS_APPLICATION_EJB_MODULE = "application:EjbModule";

    private static final String MODULEMAPS_APPLICATION_WEB_MODULE = "application:WebModule";

    private static final String MODULEMAPS_FILENAME = ".modulemaps";

    private static final String MODULEMAPS_MAPPINGS = "mappings";

    private static final String MODULEMAPS_PROJECT_NAME = "projectName";

    private static final String MODULEMAPS_UTILITY_JARMAPPINGS = "utilityJARMappings";

    private static final String URI = "uri";

    private static final String VERSION = "version";

    private static final String XMI_ID = "xmi:id";

    private static final String XMI_TYPE = "xmi:type";

    private static final String XMI_VERSION = "xmi:version";

    private static final String XMLNS = "xmlns";

    private static final String XMLNS_APPLICATION = "xmlns:application";

    private static final String XMLNS_MODULEMAP = "xmlns:modulemap";

    private static final String XMLNS_SCHEMA_LOCATION = "xmlns:schemaLocation";
FileLine
org/apache/maven/plugin/eclipse/writers/EclipseAjdtWriter.java157
org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriter.java451
        }
        else if ( dep.isReferencedProject() && config.isPde() )
        {
            // don't do anything, referenced projects are automatically handled by eclipse in PDE builds
            return;
        }
        else
        {
            File artifactPath = dep.getFile();

            if ( artifactPath == null )
            {
                log.error( Messages.getString( "EclipsePlugin.artifactpathisnull", dep.getId() ) ); //$NON-NLS-1$
                return;
            }

            if ( dep.isSystemScoped() )
            {
                path = IdeUtils.toRelativeAndFixSeparator( config.getEclipseProjectDirectory(), artifactPath, false );

                if ( log.isDebugEnabled() )
                {
                    log.debug( Messages.getString( "EclipsePlugin.artifactissystemscoped", //$NON-NLS-1$
                                                   new Object[] { dep.getArtifactId(), path } ) );
                }
FileLine
org/apache/maven/plugin/eclipse/writers/rad/RadApplicationXMLWriter.java406
org/apache/maven/plugin/eclipse/writers/wtp/EclipseWtpApplicationXMLWriter.java478
                    if ( newModulemapsXmlDomChildren[newIndex] == this.modulemapsXmlDomChildren[index] )
                    {
                        modulemapsXmlDom.removeChild( newIndex );
                        break;
                    }
                }
            }
        }
        for ( int index = 0; index < this.applicationXmlDomChildren.length; index++ )
        {
            if ( this.applicationXmlDomChildren[index] != null )
            {
                Xpp3Dom[] newApplicationXmlDomChildren = applicationXmlDom.getChildren();
                for ( int newIndex = 0; newIndex < newApplicationXmlDomChildren.length; newIndex++ )
                {
                    if ( newApplicationXmlDomChildren[newIndex] == this.applicationXmlDomChildren[index] )
                    {
                        applicationXmlDom.removeChild( newIndex );
                        break;
                    }
                }
            }
        }
    }

    /**
     * update the application.xml and the .modulemaps file for a specified dependency.all WAR an EJB dependencies will
     * go in both files all others only in the modulemaps files. Webapplications contextroots are corrected to the
     * contextRoot specified in the pom.
     * 
     * @param applicationXmlDom dom-tree of application.xml
     * @param modulemapXmlDom dom-tree of modulemaps
     * @param dependency the eclipse dependency to handle
     */
    private void updateApplicationXml( Xpp3Dom applicationXmlDom, Xpp3Dom modulemapXmlDom, IdeDependency dependency )
    {