CPD Results

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

Duplications

File Line
org/apache/maven/scm/provider/starteam/command/add/StarteamAddConsumer.java 103
org/apache/maven/scm/provider/starteam/command/checkout/StarteamCheckOutConsumer.java 105
org/apache/maven/scm/provider/starteam/command/remove/StarteamRemoveConsumer.java 103
    public List<ScmFile> getAddedFiles()
    {
        return files;
    }

    private void processDirectory( String line, int pos )
    {
        String dirPath = line.substring( pos + DIR_MARKER.length(), line.length() - 1 ).replace( '\\', '/' );

        try
        {
            this.currentDir = StarteamCommandLineUtils.getRelativeChildDirectory( this.workingDirectory, dirPath );
        }
        catch ( IllegalStateException e )
        {
            String error = "Working and checkout directories are not on the same tree";

            if ( logger.isErrorEnabled() )
            {
                logger.error( error );
                logger.error( "Working directory: " + workingDirectory );
                logger.error( "Checked out directory: " + dirPath );
            }

            throw new IllegalStateException( error );
        }
    }

    private void processAddedFile( String line, int pos )
File Line
org/apache/maven/scm/provider/starteam/command/add/StarteamAddConsumer.java 65
org/apache/maven/scm/provider/starteam/command/remove/StarteamRemoveConsumer.java 65
    public StarteamAddConsumer( ScmLogger logger, File basedir )
    {
        this.logger = logger;

        this.workingDirectory = basedir.getPath().replace( '\\', '/' );
    }

    /** {@inheritDoc} */
    public void consumeLine( String line )
    {
        if ( logger.isDebugEnabled() )
        {
            logger.debug( line );
        }

        int pos = 0;

        if ( ( pos = line.indexOf( DIR_MARKER ) ) != -1 )
        {
            processDirectory( line, pos );
        }
        else if ( ( pos = line.indexOf( ADDED_MARKER ) ) != -1 )
        {