commandLine.createArgument().setValue(getFilename()); // look for a version attribute if (getVersion() != null) { //add -revision xxxxx to the commandline commandLine.createArgument().setValue(SOSCmd.FLAG_VERSION); commandLine.createArgument().setValue(getVersion()); }
commandLine.createArgument().setValue(getRecursive()); // look for a label option if (getLabel() != null) { commandLine.createArgument().setValue(SOSCmd.FLAG_LABEL); commandLine.createArgument().setValue(getLabel()); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/sos/SOSGet.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/sos/SOSGet.java
Method name: Commandline buildCmdLine() Method name: Commandline buildCmdLine()
Number of AST nodes: 4 Number of AST nodes: 4
1
commandLine.createArgument().setValue(getFilename());
1
commandLine.createArgument().setValue(getRecursive());
2
            // look for a version attribute
2
            // look for a label option
3
            if (getVersion() != null) {
3
            if (getLabel() != null) {
4
                //add -revision xxxxx to the commandline
5
                commandLine.createArgument().setValue(SOSCmd.FLAG_VERSION);
4
                commandLine.createArgument().setValue(SOSCmd.FLAG_LABEL);
6
                commandLine.createArgument().setValue(getVersion());
5
                commandLine.createArgument().setValue(getLabel());
7
            }
6
            }
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.2
Clones locationClones are in the same method
Number of node comparisons10
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)17.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    6
    commandLine.createArgument().setValue(getFilename());
    6
    commandLine.createArgument().setValue(getFilename());
    12
    commandLine.createArgument().setValue(getRecursive());
    Differences
    Expression1Expression2Difference
    getFilenamegetRecursiveMETHOD_INVOCATION_NAME_MISMATCH
    12
    commandLine.createArgument().setValue(getRecursive());
    7
    if (getVersion() != null)
    7
    if (getVersion() != null)
    13
    if (getLabel() != null)
    Differences
    Expression1Expression2Difference
    getVersiongetLabelMETHOD_INVOCATION_NAME_MISMATCH
    13
    if (getLabel() != null)
    8
    commandLine.createArgument().setValue(SOSCmd.FLAG_VERSION);
    8
    commandLine.createArgument().setValue(SOSCmd.FLAG_VERSION);
    14
    commandLine.createArgument().setValue(SOSCmd.FLAG_LABEL);
    Differences
    Expression1Expression2Difference
    FLAG_VERSIONFLAG_LABELVARIABLE_NAME_MISMATCH
    14
    commandLine.createArgument().setValue(SOSCmd.FLAG_LABEL);
    9
    commandLine.createArgument().setValue(getVersion());
    9
    commandLine.createArgument().setValue(getVersion());
    15
    commandLine.createArgument().setValue(getLabel());
    Differences
    Expression1Expression2Difference
    getVersiongetLabelMETHOD_INVOCATION_NAME_MISMATCH
    15
    commandLine.createArgument().setValue(getLabel());
    Precondition Violations (0)
    Row Violation