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 Checkout VSS items [-G] [-C] [-H] [-I-] [-N] [-O] [-R] [-V] [-Y] [-?] // as specified in the SS.EXE help commandLine.setExecutable(getSSCommand()); commandLine.createArgument().setValue(COMMAND_CHECKOUT); // VSS items commandLine.createArgument().setValue(getVsspath()); // -GL commandLine.createArgument().setValue(getLocalpath()); // -I- or -I-Y or -I-N commandLine.createArgument().setValue(getAutoresponse()); // -R commandLine.createArgument().setValue(getRecursive()); // -V commandLine.createArgument().setValue(getVersionDateLabel()); // -Y commandLine.createArgument().setValue(getLogin()); // -G commandLine.createArgument().setValue(getFileTimeStamp()); // -GWS or -GWR commandLine.createArgument().setValue(getWritableFiles()); // -G- commandLine.createArgument().setValue(getGetLocalCopy()); return commandLine;
Commandline commandLine = new Commandline(); // build the command line from what we got the format is // ss Get VSS items [-G] [-H] [-I-] [-N] [-O] [-R] [-V] [-W] [-Y] [-?] // as specified in the SS.EXE help commandLine.setExecutable(getSSCommand()); commandLine.createArgument().setValue(COMMAND_GET); if (getVsspath() == null) { throw new BuildException("vsspath attribute must be set!", getLocation()); } commandLine.createArgument().setValue(getVsspath()); // -GL commandLine.createArgument().setValue(getLocalpath()); // -I- or -I-Y or -I-N commandLine.createArgument().setValue(getAutoresponse()); // -O- commandLine.createArgument().setValue(getQuiet()); // -R commandLine.createArgument().setValue(getRecursive()); // -V commandLine.createArgument().setValue(getVersionDateLabel()); // -W commandLine.createArgument().setValue(getWritable()); // -Y commandLine.createArgument().setValue(getLogin()); // -G commandLine.createArgument().setValue(getFileTimeStamp()); // -GWS or -GWR commandLine.createArgument().setValue(getWritableFiles()); return commandLine;
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/vss/MSVSSCHECKOUT.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/vss/MSVSSGET.java
Method name: Commandline buildCmdLine() Method name: Commandline buildCmdLine()
Number of AST nodes: 16 Number of AST nodes: 16
1
Commandline commandLine = new Commandline();
1
Commandline commandLine = new Commandline();
2
        // first off, make sure that we've got a command and a vssdir ...
3
        if (getVsspath() == null) {
4
            String msg = "vsspath attribute must be set!";
5
            throw new BuildException(msg, getLocation());
6
        }
7
        // build the command line from what we got the format is
2
        // build the command line from what we got the format is
8
        // ss Checkout VSS items [-G] [-C] [-H] [-I-] [-N] [-O] [-R] [-V] [-Y] [-?]
3
        // ss Get VSS items [-G] [-H] [-I-] [-N] [-O] [-R] [-V] [-W] [-Y] [-?]
9
        // as specified in the SS.EXE help
4
        // as specified in the SS.EXE help
10
        commandLine.setExecutable(getSSCommand());
5
        commandLine.setExecutable(getSSCommand());
11
        commandLine.createArgument().setValue(COMMAND_CHECKOUT);
6
        commandLine.createArgument().setValue(COMMAND_GET);
12
        // VSS items
7
        if (getVsspath() == null) {
8
            throw new BuildException("vsspath attribute must be set!", getLocation());
9
        }
13
        commandLine.createArgument().setValue(getVsspath());
10
        commandLine.createArgument().setValue(getVsspath());
14
        // -GL
11
        // -GL
15
        commandLine.createArgument().setValue(getLocalpath());
12
        commandLine.createArgument().setValue(getLocalpath());
16
        // -I- or -I-Y or -I-N
13
        // -I- or -I-Y or -I-N
17
        commandLine.createArgument().setValue(getAutoresponse());
14
        commandLine.createArgument().setValue(getAutoresponse());
15
        // -O-
16
        commandLine.createArgument().setValue(getQuiet());
18
        // -R
17
        // -R
19
        commandLine.createArgument().setValue(getRecursive());
18
        commandLine.createArgument().setValue(getRecursive());
20
        // -V
19
        // -V
21
        commandLine.createArgument().setValue(getVersionDateLabel());
20
        commandLine.createArgument().setValue(getVersionDateLabel());
21
        // -W
22
        commandLine.createArgument().setValue(getWritable());
22
        // -Y
23
        // -Y
23
        commandLine.createArgument().setValue(getLogin());
24
        commandLine.createArgument().setValue(getLogin());
24
        // -G
25
        // -G
25
        commandLine.createArgument().setValue(getFileTimeStamp());
26
        commandLine.createArgument().setValue(getFileTimeStamp());
26
        // -GWS or -GWR
27
        // -GWS or -GWR
27
        commandLine.createArgument().setValue(getWritableFiles());
28
        commandLine.createArgument().setValue(getWritableFiles());
28
        // -G-
29
        commandLine.createArgument().setValue(getGetLocalCopy());
30
        return commandLine;
29
        return commandLine;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in different classes having the same super class
Number of node comparisons164
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements15
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)56.8
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    Commandline commandLine = new Commandline();
    1
    Commandline commandLine = new Commandline();
    2
    if (getVsspath() == null)
    4
    if (getVsspath() == null)
    3
    String msg = "vsspath attribute must be set!";
                                                                                                  
    4
    throw new BuildException(msg, getLocation());
    4
    throw new BuildException(msg, getLocation());
    5
    throw new BuildException("vsspath attribute must be set!", getLocation());
    Differences
    Expression1Expression2Difference
    msg"vsspath attribute must be set!"TYPE_COMPATIBLE_REPLACEMENT
    5
    throw new BuildException("vsspath attribute must be set!", getLocation());
    5
    commandLine.setExecutable(getSSCommand());
    2
    commandLine.setExecutable(getSSCommand());
    6
    commandLine.createArgument().setValue(COMMAND_CHECKOUT);
    6
    commandLine.createArgument().setValue(COMMAND_CHECKOUT);
    3
    commandLine.createArgument().setValue(COMMAND_GET);
    Differences
    Expression1Expression2Difference
    COMMAND_CHECKOUTCOMMAND_GETVARIABLE_NAME_MISMATCH
    3
    commandLine.createArgument().setValue(COMMAND_GET);
    7
    commandLine.createArgument().setValue(getVsspath());
    6
    commandLine.createArgument().setValue(getVsspath());
    8
    commandLine.createArgument().setValue(getLocalpath());
    7
    commandLine.createArgument().setValue(getLocalpath());
    9
    commandLine.createArgument().setValue(getAutoresponse());
    8
    commandLine.createArgument().setValue(getAutoresponse());
    10
    commandLine.createArgument().setValue(getRecursive());
    10
    commandLine.createArgument().setValue(getRecursive());
    9
    commandLine.createArgument().setValue(getQuiet());
    Differences
    Expression1Expression2Difference
    getRecursivegetQuietMETHOD_INVOCATION_NAME_MISMATCH
    9
    commandLine.createArgument().setValue(getQuiet());
    11
    commandLine.createArgument().setValue(getVersionDateLabel());
    11
    commandLine.createArgument().setValue(getVersionDateLabel());
    10
    commandLine.createArgument().setValue(getRecursive());
    Differences
    Expression1Expression2Difference
    getVersionDateLabelgetRecursiveMETHOD_INVOCATION_NAME_MISMATCH
    10
    commandLine.createArgument().setValue(getRecursive());
    12
    commandLine.createArgument().setValue(getLogin());
    12
    commandLine.createArgument().setValue(getLogin());
    11
    commandLine.createArgument().setValue(getVersionDateLabel());
    Differences
    Expression1Expression2Difference
    getLogingetVersionDateLabelMETHOD_INVOCATION_NAME_MISMATCH
    11
    commandLine.createArgument().setValue(getVersionDateLabel());
    13
    commandLine.createArgument().setValue(getFileTimeStamp());
    13
    commandLine.createArgument().setValue(getFileTimeStamp());
    12
    commandLine.createArgument().setValue(getWritable());
    Differences
    Expression1Expression2Difference
    getFileTimeStampgetWritableMETHOD_INVOCATION_NAME_MISMATCH
    12
    commandLine.createArgument().setValue(getWritable());
    14
    commandLine.createArgument().setValue(getWritableFiles());
    14
    commandLine.createArgument().setValue(getWritableFiles());
    13
    commandLine.createArgument().setValue(getLogin());
    Differences
    Expression1Expression2Difference
    getWritableFilesgetLoginMETHOD_INVOCATION_NAME_MISMATCH
    13
    commandLine.createArgument().setValue(getLogin());
    15
    commandLine.createArgument().setValue(getGetLocalCopy());
    15
    commandLine.createArgument().setValue(getGetLocalCopy());
    14
    commandLine.createArgument().setValue(getFileTimeStamp());
    Differences
    Expression1Expression2Difference
    getGetLocalCopygetFileTimeStampMETHOD_INVOCATION_NAME_MISMATCH
    14
    commandLine.createArgument().setValue(getFileTimeStamp());
                                                                                                                                
    15
    commandLine.createArgument().setValue(getWritableFiles());
    16
    return commandLine;
    16
    return commandLine;
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables , while Clone fragment #2 returns variables commandLine