if (getViewPath() == null) { setViewPath(aProj.getBaseDir().getPath()); } // build the command line from what we got. the format is // cleartool checkin [options...] [viewpath ...] // as specified in the CLEARTOOL.EXE help commandLine.setExecutable(getClearToolCommand()); commandLine.createArgument().setValue(COMMAND_MKBL); checkOptions(commandLine); if (!getFailOnErr()) { getProject().log("Ignoring any errors that occur for: " + getBaselineRootName(), Project.MSG_VERBOSE); } result = run(commandLine); if (Execute.isFailure(result) && getFailOnErr()) { String msg = "Failed executing: " + commandLine.toString(); throw new BuildException(msg, getLocation()); }
if (getViewPath() == null) { setViewPath(aProj.getBaseDir().getPath()); } // build the command line from what we got. the format is // cleartool mkelem [options...] [viewpath ...] // as specified in the CLEARTOOL.EXE help commandLine.setExecutable(getClearToolCommand()); commandLine.createArgument().setValue(COMMAND_MKELEM); checkOptions(commandLine); if (!getFailOnErr()) { getProject().log("Ignoring any errors that occur for: " + getViewPathBasename(), Project.MSG_VERBOSE); } result = run(commandLine); if (Execute.isFailure(result) && getFailOnErr()) { 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/clearcase/CCMkbl.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/clearcase/CCMkelem.java
Method name: void execute() Method name: void execute()
Number of AST nodes: 11 Number of AST nodes: 11
1
if (getViewPath() == null) {
1
if (getViewPath() == null) {
2
            setViewPath(aProj.getBaseDir().getPath());
2
            setViewPath(aProj.getBaseDir().getPath());
3
        }
3
        }
4
        // build the command line from what we got. the format is
4
        // build the command line from what we got. the format is
5
        // cleartool checkin [options...] [viewpath ...]
5
        // cleartool mkelem [options...] [viewpath ...]
6
        // as specified in the CLEARTOOL.EXE help
6
        // as specified in the CLEARTOOL.EXE help
7
        commandLine.setExecutable(getClearToolCommand());
7
        commandLine.setExecutable(getClearToolCommand());
8
        commandLine.createArgument().setValue(COMMAND_MKBL);
8
        commandLine.createArgument().setValue(COMMAND_MKELEM);
9
        checkOptions(commandLine);
9
        checkOptions(commandLine);
10
        if (!getFailOnErr()) {
10
        if (!getFailOnErr()) {
11
            getProject().log("Ignoring any errors that occur for: "
11
            getProject().log("Ignoring any errors that occur for: "
12
                    + getBaselineRootName(), Project.MSG_VERBOSE);
12
                    + getViewPathBasename(), Project.MSG_VERBOSE);
13
        }
13
        }
14
        result = run(commandLine);
14
        result = run(commandLine);
15
        if (Execute.isFailure(result) && getFailOnErr()) {
15
        if (Execute.isFailure(result) && getFailOnErr()) {
16
            String msg = "Failed executing: " + commandLine.toString();
16
            String msg = "Failed executing: " + commandLine.toString();
17
            throw new BuildException(msg, getLocation());
17
            throw new BuildException(msg, getLocation());
18
        }
18
        }
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.6
Clones locationClones are in different classes having the same super class
Number of node comparisons39
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements11
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)30.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    if (getViewPath() == null)
    4
    if (getViewPath() == null)
    5
    setViewPath(aProj.getBaseDir().getPath());
    5
    setViewPath(aProj.getBaseDir().getPath());
    6
    commandLine.setExecutable(getClearToolCommand());
    6
    commandLine.setExecutable(getClearToolCommand());
    7
    commandLine.createArgument().setValue(COMMAND_MKBL);
    7
    commandLine.createArgument().setValue(COMMAND_MKBL);
    7
    commandLine.createArgument().setValue(COMMAND_MKELEM);
    Differences
    Expression1Expression2Difference
    COMMAND_MKBLCOMMAND_MKELEMVARIABLE_NAME_MISMATCH
    7
    commandLine.createArgument().setValue(COMMAND_MKELEM);
    8
    checkOptions(commandLine);
    8
    checkOptions(commandLine);
    9
    if (!getFailOnErr())
    9
    if (!getFailOnErr())
    10
    getProject().log("Ignoring any errors that occur for: " + getBaselineRootName(), Project.MSG_VERBOSE);
    10
    getProject().log("Ignoring any errors that occur for: " + getBaselineRootName(), Project.MSG_VERBOSE);
    10
    getProject().log("Ignoring any errors that occur for: " + getViewPathBasename(), Project.MSG_VERBOSE);
    Differences
    Expression1Expression2Difference
    getBaselineRootNamegetViewPathBasenameMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression getViewPathBasename() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    getProject().log("Ignoring any errors that occur for: " + getViewPathBasename(), Project.MSG_VERBOSE);
    11
    result = run(commandLine);
    11
    result = run(commandLine);
    12
    if (Execute.isFailure(result) && getFailOnErr())
    12
    if (Execute.isFailure(result) && getFailOnErr())
    13
    String msg = "Failed executing: " + commandLine.toString();
    13
    String msg = "Failed executing: " + commandLine.toString();
    14
    throw new BuildException(msg, getLocation());
    14
    throw new BuildException(msg, getLocation());
    Precondition Violations (1)
    Row Violation
    1Expression getViewPathBasename() cannot be parameterized, because it has dependencies to/from statements that will be extracted