commandLine.createArgument().setValue(FLAG_SOS_HOME); commandLine.createArgument().setValue(getSosHome()); } //If a working directory was specified then add it to the command line if (getLocalPath() != null) { commandLine.createArgument().setValue(FLAG_WORKING_DIR); commandLine.createArgument().setValue(getLocalPath()); }
cmd.createArgument().setValue(FLAG_COMMENT); cmd.createArgument().setValue(getComment()); } if (getTask() != null) { cmd.createArgument().setValue(FLAG_TASK); cmd.createArgument().setValue(getTask()); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/sos/SOS.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ccm/CCMCheck.java
Method name: void getOptionalAttributes() Method name: void checkOptions(Commandline)
Number of AST nodes: 5 Number of AST nodes: 5
1
commandLine.createArgument().setValue(FLAG_SOS_HOME);
1
cmd.createArgument().setValue(FLAG_COMMENT);
2
            commandLine.createArgument().setValue(getSosHome());
2
            cmd.createArgument().setValue(getComment());
3
        }
3
        }
4
        //If a working directory was specified then add it to the command line
5
        if (getLocalPath() != null) {
4
        if (getTask() != null) {
6
            commandLine.createArgument().setValue(FLAG_WORKING_DIR);
5
            cmd.createArgument().setValue(FLAG_TASK);
7
            commandLine.createArgument().setValue(getLocalPath());
6
            cmd.createArgument().setValue(getTask());
8
        }
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 comparisons9
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)4.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    7
    if (getLocalPath() != null)
    7
    if (getLocalPath() != null)
    4
    if (getTask() != null)
    Differences
    Expression1Expression2Difference
    getLocalPathgetTaskMETHOD_INVOCATION_NAME_MISMATCH
    4
    if (getTask() != null)
    8
    commandLine.createArgument().setValue(FLAG_WORKING_DIR);
    8
    commandLine.createArgument().setValue(FLAG_WORKING_DIR);
    5
    cmd.createArgument().setValue(FLAG_TASK);
    Differences
    Expression1Expression2Difference
    FLAG_WORKING_DIRFLAG_TASKVARIABLE_NAME_MISMATCH
    commandLinecmdVARIABLE_NAME_MISMATCH
    5
    cmd.createArgument().setValue(FLAG_TASK);
    9
    commandLine.createArgument().setValue(getLocalPath());
    9
    commandLine.createArgument().setValue(getLocalPath());
    6
    cmd.createArgument().setValue(getTask());
    Differences
    Expression1Expression2Difference
    getLocalPathgetTaskMETHOD_INVOCATION_NAME_MISMATCH
    commandLinecmdVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression getLocalPath() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    6
    cmd.createArgument().setValue(getTask());
    Precondition Violations (1)
    Row Violation
    1Expression getLocalPath() is a method call throwing exception(s) that should be caught by a try block that will be extracted