Commandline commandLine = new Commandline(); int result = 0; // build the command line from what we got the format // as specified in the CCM.EXE help commandLine.setExecutable(getCcmCommand()); commandLine.createArgument().setValue(getCcmAction()); checkOptions(commandLine); result = run(commandLine); if (Execute.isFailure(result)) { String msg = "Failed executing: " + commandLine.toString(); throw new BuildException(msg, getLocation()); }
Commandline commandLine = new Commandline(); // build the command line from what we got the format is // ccm co /t .. files // as specified in the CCM.EXE help commandLine.setExecutable(getCcmCommand()); commandLine.createArgument().setValue(getCcmAction()); checkOptions(commandLine); int result = run(commandLine); if (Execute.isFailure(result)) { String msg = "Failed executing: " + commandLine.toString(); throw new BuildException(msg, getLocation()); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ccm/CCMReconfigure.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ccm/CCMCheck.java
Method name: void execute() Method name: void doit()
Number of AST nodes: 9 Number of AST nodes: 8
1
Commandline commandLine = new Commandline();
1
Commandline commandLine = new Commandline();
2
        int result = 0;
3
        // build the command line from what we got the format
2
        // build the command line from what we got the format is
3
        // ccm co /t .. files
4
        // as specified in the CCM.EXE help
4
        // as specified in the CCM.EXE help
5
        commandLine.setExecutable(getCcmCommand());
5
        commandLine.setExecutable(getCcmCommand());
6
        commandLine.createArgument().setValue(getCcmAction());
6
        commandLine.createArgument().setValue(getCcmAction());
7
        checkOptions(commandLine);
7
        checkOptions(commandLine);
8
        result = run(commandLine);
8
        int result = run(commandLine);
9
        if (Execute.isFailure(result)) {
9
        if (Execute.isFailure(result)) {
10
            String msg = "Failed executing: " + commandLine.toString();
10
            String msg = "Failed executing: " + commandLine.toString();
11
            throw new BuildException(msg, getLocation());
11
            throw new BuildException(msg, getLocation());
12
        }
12
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
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 comparisons27
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.9
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    Commandline commandLine = new Commandline();
    1
    Commandline commandLine = new Commandline();
    2
    int result = 0;
    2
    int result = 0;
    5
    int result = run(commandLine);
    Differences
    Expression1Expression2Difference
    0run(commandLine)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression run(commandLine) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    int result = run(commandLine);
    3
    commandLine.setExecutable(getCcmCommand());
    2
    commandLine.setExecutable(getCcmCommand());
    4
    commandLine.createArgument().setValue(getCcmAction());
    3
    commandLine.createArgument().setValue(getCcmAction());
    5
    checkOptions(commandLine);
    4
    checkOptions(commandLine);
    6
    result = run(commandLine);
    6
    result = run(commandLine);
    Preondition Violations
    Unmatched statement result=run(commandLine); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                          
    7
    if (Execute.isFailure(result))
    6
    if (Execute.isFailure(result))
    8
    String msg = "Failed executing: " + commandLine.toString();
    7
    String msg = "Failed executing: " + commandLine.toString();
    9
    throw new BuildException(msg, getLocation());
    8
    throw new BuildException(msg, getLocation());
    Precondition Violations (3)
    Row Violation
    1Expression run(commandLine) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Unmatched statement result=run(commandLine); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Clone fragment #1 returns variables commandLine, result , while Clone fragment #2 returns variables