if (getFilename() != null) { // add -command CheckInFile to the commandline commandLine.createArgument().setValue(SOSCmd.FLAG_COMMAND); commandLine.createArgument().setValue(SOSCmd.COMMAND_CHECKIN_FILE); // add -file xxxxx to the commandline commandLine.createArgument().setValue(SOSCmd.FLAG_FILE); commandLine.createArgument().setValue(getFilename()); } else { // add -command CheckInProject to the commandline commandLine.createArgument().setValue(SOSCmd.FLAG_COMMAND); commandLine.createArgument().setValue(SOSCmd.COMMAND_CHECKIN_PROJECT); // look for a recursive option commandLine.createArgument().setValue(getRecursive()); }
if (getFilename() != null) { // add -command CheckOutFile to the commandline commandLine.createArgument().setValue(SOSCmd.FLAG_COMMAND); commandLine.createArgument().setValue(SOSCmd.COMMAND_CHECKOUT_FILE); // add -file xxxxx to the commandline commandLine.createArgument().setValue(SOSCmd.FLAG_FILE); commandLine.createArgument().setValue(getFilename()); } else { // add -command CheckOutProject to the commandline commandLine.createArgument().setValue(SOSCmd.FLAG_COMMAND); commandLine.createArgument().setValue(SOSCmd.COMMAND_CHECKOUT_PROJECT); // look for a recursive option 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/sos/SOSCheckin.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/sos/SOSCheckout.java
Method name: Commandline buildCmdLine() Method name: Commandline buildCmdLine()
Number of AST nodes: 8 Number of AST nodes: 8
1
if (getFilename() != null) {
1
if (getFilename() != null) {
2
            // add -command CheckInFile to the commandline
2
            // add -command CheckOutFile to the commandline
3
            commandLine.createArgument().setValue(SOSCmd.FLAG_COMMAND);
3
            commandLine.createArgument().setValue(SOSCmd.FLAG_COMMAND);
4
            commandLine.createArgument().setValue(SOSCmd.COMMAND_CHECKIN_FILE);
4
            commandLine.createArgument().setValue(SOSCmd.COMMAND_CHECKOUT_FILE);
5
            // add -file xxxxx to the commandline
5
            // add -file xxxxx to the commandline
6
            commandLine.createArgument().setValue(SOSCmd.FLAG_FILE);
6
            commandLine.createArgument().setValue(SOSCmd.FLAG_FILE);
7
            commandLine.createArgument().setValue(getFilename());
7
            commandLine.createArgument().setValue(getFilename());
8
        } else {
8
        } else {
9
            // add -command CheckInProject to the commandline
9
            // add -command CheckOutProject to the commandline
10
            commandLine.createArgument().setValue(SOSCmd.FLAG_COMMAND);
10
            commandLine.createArgument().setValue(SOSCmd.FLAG_COMMAND);
11
            commandLine.createArgument().setValue(SOSCmd.COMMAND_CHECKIN_PROJECT);
11
            commandLine.createArgument().setValue(SOSCmd.COMMAND_CHECKOUT_PROJECT);
12
            // look for a recursive option
12
            // look for a recursive option
13
            commandLine.createArgument().setValue(getRecursive());
13
            commandLine.createArgument().setValue(getRecursive());
14
        }
14
        }
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 comparisons64
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)7.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    if (getFilename() != null)
    2
    if (getFilename() != null)
    3
    commandLine.createArgument().setValue(SOSCmd.FLAG_COMMAND);
    3
    commandLine.createArgument().setValue(SOSCmd.FLAG_COMMAND);
    4
    commandLine.createArgument().setValue(SOSCmd.COMMAND_CHECKIN_FILE);
    4
    commandLine.createArgument().setValue(SOSCmd.COMMAND_CHECKIN_FILE);
    4
    commandLine.createArgument().setValue(SOSCmd.COMMAND_CHECKOUT_FILE);
    Differences
    Expression1Expression2Difference
    COMMAND_CHECKIN_FILECOMMAND_CHECKOUT_FILEVARIABLE_NAME_MISMATCH
    4
    commandLine.createArgument().setValue(SOSCmd.COMMAND_CHECKOUT_FILE);
    5
    commandLine.createArgument().setValue(SOSCmd.FLAG_FILE);
    5
    commandLine.createArgument().setValue(SOSCmd.FLAG_FILE);
    6
    commandLine.createArgument().setValue(getFilename());
    6
    commandLine.createArgument().setValue(getFilename());
    else
    else
    7
    commandLine.createArgument().setValue(SOSCmd.FLAG_COMMAND);
    7
    commandLine.createArgument().setValue(SOSCmd.FLAG_COMMAND);
    8
    commandLine.createArgument().setValue(SOSCmd.COMMAND_CHECKIN_PROJECT);
    8
    commandLine.createArgument().setValue(SOSCmd.COMMAND_CHECKIN_PROJECT);
    8
    commandLine.createArgument().setValue(SOSCmd.COMMAND_CHECKOUT_PROJECT);
    Differences
    Expression1Expression2Difference
    COMMAND_CHECKIN_PROJECTCOMMAND_CHECKOUT_PROJECTVARIABLE_NAME_MISMATCH
    8
    commandLine.createArgument().setValue(SOSCmd.COMMAND_CHECKOUT_PROJECT);
    9
    commandLine.createArgument().setValue(getRecursive());
    9
    commandLine.createArgument().setValue(getRecursive());
    Precondition Violations (0)
    Row Violation