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_PLATFORM); cmd.createArgument().setValue(getPlatform()); } // end of if () if (getResolver() != null) { cmd.createArgument().setValue(FLAG_RESOLVER); cmd.createArgument().setValue(getResolver()); }
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/CCMCreateTask.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_PLATFORM);
2
            commandLine.createArgument().setValue(getSosHome());
2
            cmd.createArgument().setValue(getPlatform());
3
        }
3
        }
4
        //If a working directory was specified then add it to the command line
4
 // end of if ()
5
        if (getLocalPath() != null) {
5
        if (getResolver() != null) {
6
            commandLine.createArgument().setValue(FLAG_WORKING_DIR);
6
            cmd.createArgument().setValue(FLAG_RESOLVER);
7
            commandLine.createArgument().setValue(getLocalPath());
7
            cmd.createArgument().setValue(getResolver());
8
        }
8
        }
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.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    7
    if (getLocalPath() != null)
    7
    if (getLocalPath() != null)
    7
    if (getResolver() != null)
    Differences
    Expression1Expression2Difference
    getLocalPathgetResolverMETHOD_INVOCATION_NAME_MISMATCH
    7
    if (getResolver() != null)
    8
    commandLine.createArgument().setValue(FLAG_WORKING_DIR);
    8
    commandLine.createArgument().setValue(FLAG_WORKING_DIR);
    8
    cmd.createArgument().setValue(FLAG_RESOLVER);
    Differences
    Expression1Expression2Difference
    FLAG_WORKING_DIRFLAG_RESOLVERVARIABLE_NAME_MISMATCH
    commandLinecmdVARIABLE_NAME_MISMATCH
    8
    cmd.createArgument().setValue(FLAG_RESOLVER);
    9
    commandLine.createArgument().setValue(getLocalPath());
    9
    commandLine.createArgument().setValue(getLocalPath());
    9
    cmd.createArgument().setValue(getResolver());
    Differences
    Expression1Expression2Difference
    getLocalPathgetResolverMETHOD_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
    9
    cmd.createArgument().setValue(getResolver());
    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