Commandline commandLine = new Commandline(); // first off, make sure that we've got a command and a vssdir ... if (getVsspath() == null) { String msg = "vsspath attribute must be set!"; throw new BuildException(msg, getLocation()); } // build the command line from what we got the format is // ss CP VSS items [-H] [-I-] [-Y] [-?] // as specified in the SS.EXE help commandLine.setExecutable(getSSCommand()); commandLine.createArgument().setValue(COMMAND_CP); // VSS items commandLine.createArgument().setValue(getVsspath()); // -I- or -I-Y or -I-N commandLine.createArgument().setValue(getAutoresponse()); // -Y commandLine.createArgument().setValue(getLogin());
Commandline commandLine = new Commandline(); // first off, make sure that we've got a command and a localPath ... if (getLocalpath() == null) { String msg = "localPath attribute must be set!"; throw new BuildException(msg, getLocation()); } // build the command line from what we got the format is // ss Add VSS items [-B] [-C] [-D-] [-H] [-I-] [-K] [-N] [-O] [-R] [-W] [-Y] [-?] // as specified in the SS.EXE help commandLine.setExecutable(getSSCommand()); commandLine.createArgument().setValue(COMMAND_ADD); // VSS items commandLine.createArgument().setValue(getLocalpath()); // -I- or -I-Y or -I-N commandLine.createArgument().setValue(getAutoresponse()); // -R commandLine.createArgument().setValue(getRecursive());
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/vss/MSVSSCP.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/vss/MSVSSADD.java
Method name: Commandline buildCmdLine() Method name: Commandline buildCmdLine()
Number of AST nodes: 9 Number of AST nodes: 9
1
Commandline commandLine = new Commandline();
1
Commandline commandLine = new Commandline();
2
        // first off, make sure that we've got a command and a vssdir ...
2
        // first off, make sure that we've got a command and a localPath ...
3
        if (getVsspath() == null) {
3
        if (getLocalpath() == null) {
4
            String msg = "vsspath attribute must be set!";
4
            String msg = "localPath attribute must be set!";
5
            throw new BuildException(msg, getLocation());
5
            throw new BuildException(msg, getLocation());
6
        }
6
        }
7
        // build the command line from what we got the format is
7
        // build the command line from what we got the format is
8
        // ss CP VSS items [-H] [-I-] [-Y] [-?]
8
        // ss Add VSS items [-B] [-C] [-D-] [-H] [-I-] [-K] [-N] [-O] [-R] [-W] [-Y] [-?]
9
        // as specified in the SS.EXE help
9
        // as specified in the SS.EXE help
10
        commandLine.setExecutable(getSSCommand());
10
        commandLine.setExecutable(getSSCommand());
11
        commandLine.createArgument().setValue(COMMAND_CP);
11
        commandLine.createArgument().setValue(COMMAND_ADD);
12
        // VSS items
12
        // VSS items
13
        commandLine.createArgument().setValue(getVsspath());
13
        commandLine.createArgument().setValue(getLocalpath());
14
        // -I- or -I-Y or -I-N
14
        // -I- or -I-Y or -I-N
15
        commandLine.createArgument().setValue(getAutoresponse());
15
        commandLine.createArgument().setValue(getAutoresponse());
16
        // -Y
16
        // -R
17
        commandLine.createArgument().setValue(getLogin());
17
        commandLine.createArgument().setValue(getRecursive());
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in different classes having the same super class
Number of node comparisons45
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)132.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Commandline commandLine = new Commandline();
    1
    Commandline commandLine = new Commandline();
    2
    if (getVsspath() == null)
    2
    if (getVsspath() == null)
    2
    if (getLocalpath() == null)
    Differences
    Expression1Expression2Difference
    getVsspathgetLocalpathMETHOD_INVOCATION_NAME_MISMATCH
    2
    if (getLocalpath() == null)
    3
    String msg = "vsspath attribute must be set!";
    3
    String msg = "vsspath attribute must be set!";
    3
    String msg = "localPath attribute must be set!";
    Differences
    Expression1Expression2Difference
    "vsspath attribute must be set!""localPath attribute must be set!"LITERAL_VALUE_MISMATCH
    3
    String msg = "localPath attribute must be set!";
    4
    throw new BuildException(msg, getLocation());
    4
    throw new BuildException(msg, getLocation());
    5
    commandLine.setExecutable(getSSCommand());
    5
    commandLine.setExecutable(getSSCommand());
    6
    commandLine.createArgument().setValue(COMMAND_CP);
    6
    commandLine.createArgument().setValue(COMMAND_CP);
    6
    commandLine.createArgument().setValue(COMMAND_ADD);
    Differences
    Expression1Expression2Difference
    COMMAND_CPCOMMAND_ADDVARIABLE_NAME_MISMATCH
    6
    commandLine.createArgument().setValue(COMMAND_ADD);
    7
    commandLine.createArgument().setValue(getVsspath());
    7
    commandLine.createArgument().setValue(getVsspath());
    7
    commandLine.createArgument().setValue(getLocalpath());
    Differences
    Expression1Expression2Difference
    getVsspathgetLocalpathMETHOD_INVOCATION_NAME_MISMATCH
    7
    commandLine.createArgument().setValue(getLocalpath());
    8
    commandLine.createArgument().setValue(getAutoresponse());
    8
    commandLine.createArgument().setValue(getAutoresponse());
    9
    commandLine.createArgument().setValue(getLogin());
    9
    commandLine.createArgument().setValue(getLogin());
    9
    commandLine.createArgument().setValue(getRecursive());
    Differences
    Expression1Expression2Difference
    getLogingetRecursiveMETHOD_INVOCATION_NAME_MISMATCH
    9
    commandLine.createArgument().setValue(getRecursive());
    Precondition Violations (0)
    Row Violation