CPD Results

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

Duplications

File Line
org/apache/maven/scm/provider/clearcase/command/add/ClearCaseAddCommand.java 55
org/apache/maven/scm/provider/clearcase/command/remove/ClearCaseRemoveCommand.java 58
        ClearCaseAddConsumer consumer = new ClearCaseAddConsumer( getLogger() );

        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();

        int exitCode;

        try
        {
            // First we need to 'check out' the current directory
            Commandline checkoutCurrentDirCommandLine =
                ClearCaseEditCommand.createCheckoutCurrentDirCommandLine( scmFileSet );
            if ( getLogger().isDebugEnabled() )
            {
                getLogger().debug(
                                   "Executing: "
                                       + checkoutCurrentDirCommandLine.getWorkingDirectory().getAbsolutePath()
                                       + ">>" + checkoutCurrentDirCommandLine.toString() );
            }
            exitCode = CommandLineUtils.executeCommandLine( checkoutCurrentDirCommandLine,
                                                            new CommandLineUtils.StringStreamConsumer(), stderr );

            if ( exitCode == 0 )
            {
                // Then we add the file
                if ( getLogger().isDebugEnabled() )
                {
                    getLogger().debug(
                                       "Executing: " + cl.getWorkingDirectory().getAbsolutePath() + ">>"
                                           + cl.toString() );
                }
                exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr );

                if ( exitCode == 0 )
                {
                    // Then we check in the current directory again.
                    Commandline checkinCurrentDirCommandLine =
                        ClearCaseEditCommand.createCheckinCurrentDirCommandLine( scmFileSet );
                    if ( getLogger().isDebugEnabled() )
                    {
                        getLogger().debug(
                                           "Executing: "
                                               + checkinCurrentDirCommandLine.getWorkingDirectory().getAbsolutePath()
                                               + ">>" + checkinCurrentDirCommandLine.toString() );
                    }
                    exitCode = CommandLineUtils.executeCommandLine( checkinCurrentDirCommandLine,
                                                                    new CommandLineUtils.StringStreamConsumer(),
                                                                    stderr );
                }
            }
        }
        catch ( CommandLineException ex )
        {
            throw new ScmException( "Error while executing clearcase command.", ex );
        }

        if ( exitCode != 0 )
        {
            return new StatusScmResult( cl.toString(), "The cleartool command failed.", stderr.getOutput(), false );
        }

        return new StatusScmResult( cl.toString(), consumer.getAddedFiles() );
File Line
org/apache/maven/scm/provider/clearcase/command/status/ClearCaseStatusCommand.java 52
org/apache/maven/scm/provider/clearcase/command/unedit/ClearCaseUnEditCommand.java 56
        ClearCaseStatusConsumer consumer = new ClearCaseStatusConsumer( getLogger(), scmFileSet.getBasedir() );

        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();

        int exitCode;

        try
        {
            if ( getLogger().isDebugEnabled() )
            {
                getLogger().debug(
                                   "Executing: " + cl.getWorkingDirectory().getAbsolutePath() + ">>"
                                       + cl.toString() );
            }
            exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr );
        }
        catch ( CommandLineException ex )
        {
            throw new ScmException( "Error while executing clearcase command.", ex );
        }

        if ( exitCode != 0 )
        {
            return new StatusScmResult( cl.toString(), "The cleartool command failed.", stderr.getOutput(), false );
        }

        return new StatusScmResult( cl.toString(), consumer.getCheckedOutFiles() );