commandLine.createArgument().setValue(getVerbose()); // Look for a comment if (getComment() != null) { commandLine.createArgument().setValue(SOSCmd.FLAG_COMMENT); commandLine.createArgument().setValue(getComment()); }
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()); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/sos/SOSLabel.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(getVerbose());
1
commandLine.createArgument().setValue(getFilename());
2
        // Look for a comment
2
            // look for a version attribute
3
        if (getComment() != null) {
3
            if (getVersion() != null) {
4
                //add -revision xxxxx to the commandline
4
            commandLine.createArgument().setValue(SOSCmd.FLAG_COMMENT);
5
                commandLine.createArgument().setValue(SOSCmd.FLAG_VERSION);
5
            commandLine.createArgument().setValue(getComment());
6
                commandLine.createArgument().setValue(getVersion());
6
        }
7
            }
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 different classes having the same super class
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)18.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    9
    commandLine.createArgument().setValue(getVerbose());
    9
    commandLine.createArgument().setValue(getVerbose());
    6
    commandLine.createArgument().setValue(getFilename());
    Differences
    Expression1Expression2Difference
    getVerbosegetFilenameMETHOD_INVOCATION_NAME_MISMATCH
    6
    commandLine.createArgument().setValue(getFilename());
    10
    if (getComment() != null)
    10
    if (getComment() != null)
    7
    if (getVersion() != null)
    Differences
    Expression1Expression2Difference
    getCommentgetVersionMETHOD_INVOCATION_NAME_MISMATCH
    7
    if (getVersion() != null)
    11
    commandLine.createArgument().setValue(SOSCmd.FLAG_COMMENT);
    11
    commandLine.createArgument().setValue(SOSCmd.FLAG_COMMENT);
    8
    commandLine.createArgument().setValue(SOSCmd.FLAG_VERSION);
    Differences
    Expression1Expression2Difference
    FLAG_COMMENTFLAG_VERSIONVARIABLE_NAME_MISMATCH
    8
    commandLine.createArgument().setValue(SOSCmd.FLAG_VERSION);
    12
    commandLine.createArgument().setValue(getComment());
    12
    commandLine.createArgument().setValue(getComment());
    9
    commandLine.createArgument().setValue(getVersion());
    Differences
    Expression1Expression2Difference
    getCommentgetVersionMETHOD_INVOCATION_NAME_MISMATCH
    9
    commandLine.createArgument().setValue(getVersion());
    Precondition Violations (0)
    Row Violation