Commandline commandLine = new Commandline(); int result = 0; // Check for required attributes if (getTypeKind() == null) { throw new BuildException("Required attribute TypeKind not specified"); } if (getTypeName() == null) { throw new BuildException("Required attribute TypeName not specified"); } // build the command line from what we got. the format is // cleartool rmtype [options...] type-selector... // as specified in the CLEARTOOL help commandLine.setExecutable(getClearToolCommand()); commandLine.createArgument().setValue(COMMAND_RMTYPE); checkOptions(commandLine); if (!getFailOnErr()) { getProject().log("Ignoring any errors that occur for: " + getTypeSpecifier(), Project.MSG_VERBOSE); } result = run(commandLine); if (Execute.isFailure(result) && getFailOnErr()) { String msg = "Failed executing: " + commandLine.toString(); throw new BuildException(msg, getLocation()); }
Commandline commandLine = new Commandline(); int result = 0; // Check for required attributes if (getTypeName() == null) { throw new BuildException("Required attribute TypeName not specified"); } // build the command line from what we got. the format is // cleartool mklbtype [options...] type-selector... // as specified in the CLEARTOOL help commandLine.setExecutable(getClearToolCommand()); commandLine.createArgument().setValue(COMMAND_MKLBTYPE); checkOptions(commandLine); if (!getFailOnErr()) { getProject().log("Ignoring any errors that occur for: " + getTypeSpecifier(), 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/CCRmtype.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/clearcase/CCMklbtype.java
Method name: void execute() Method name: void execute()
Number of AST nodes: 15 Number of AST nodes: 13
1
Commandline commandLine = new Commandline();
1
Commandline commandLine = new Commandline();
2
        int result = 0;
2
        int result = 0;
3
        // Check for required attributes
3
        // Check for required attributes
4
        if (getTypeKind() == null) {
5
            throw new BuildException("Required attribute TypeKind not specified");
6
        }
7
        if (getTypeName() == null) {
4
        if (getTypeName() == null) {
8
            throw new BuildException("Required attribute TypeName not specified");
5
            throw new BuildException("Required attribute TypeName not specified");
9
        }
6
        }
10
        // build the command line from what we got. the format is
7
        // build the command line from what we got. the format is
11
        // cleartool rmtype [options...] type-selector...
8
        // cleartool mklbtype [options...] type-selector...
12
        // as specified in the CLEARTOOL help
9
        // as specified in the CLEARTOOL help
13
        commandLine.setExecutable(getClearToolCommand());
10
        commandLine.setExecutable(getClearToolCommand());
14
        commandLine.createArgument().setValue(COMMAND_RMTYPE);
11
        commandLine.createArgument().setValue(COMMAND_MKLBTYPE);
15
        checkOptions(commandLine);
12
        checkOptions(commandLine);
16
        if (!getFailOnErr()) {
13
        if (!getFailOnErr()) {
17
            getProject().log("Ignoring any errors that occur for: "
14
            getProject().log("Ignoring any errors that occur for: "
18
                    + getTypeSpecifier(), Project.MSG_VERBOSE);
15
                    + getTypeSpecifier(), Project.MSG_VERBOSE);
19
        }
16
        }
20
        result = run(commandLine);
17
        result = run(commandLine);
21
        if (Execute.isFailure(result) && getFailOnErr()) {
18
        if (Execute.isFailure(result) && getFailOnErr()) {
22
            String msg = "Failed executing: " + commandLine.toString();
19
            String msg = "Failed executing: " + commandLine.toString();
23
            throw new BuildException(msg, getLocation());
20
            throw new BuildException(msg, getLocation());
24
        }
21
        }
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.7
Clones locationClones are in different classes having the same super class
Number of node comparisons59
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements13
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.3
    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;
    3
    if (getTypeKind() == null)
    3
    if (getTypeKind() == null)
    3
    if (getTypeName() == null)
    Differences
    Expression1Expression2Difference
    getTypeKindgetTypeNameMETHOD_INVOCATION_NAME_MISMATCH
    3
    if (getTypeName() == null)
    4
    throw new BuildException("Required attribute TypeKind not specified");
    4
    throw new BuildException("Required attribute TypeKind not specified");
    4
    throw new BuildException("Required attribute TypeName not specified");
    Differences
    Expression1Expression2Difference
    "Required attribute TypeKind not specified""Required attribute TypeName not specified"LITERAL_VALUE_MISMATCH
    4
    throw new BuildException("Required attribute TypeName not specified");
    5
    if (getTypeName() == null)
                                                            
    6
    throw new BuildException("Required attribute TypeName not specified");
    6
    throw new BuildException("Required attribute TypeName not specified");
    Preondition Violations
    Unmatched throw new BuildException("Required attribute TypeName not specified");
                                                                                                                                                      
    7
    commandLine.setExecutable(getClearToolCommand());
    5
    commandLine.setExecutable(getClearToolCommand());
    8
    commandLine.createArgument().setValue(COMMAND_RMTYPE);
    8
    commandLine.createArgument().setValue(COMMAND_RMTYPE);
    6
    commandLine.createArgument().setValue(COMMAND_MKLBTYPE);
    Differences
    Expression1Expression2Difference
    COMMAND_RMTYPECOMMAND_MKLBTYPEVARIABLE_NAME_MISMATCH
    6
    commandLine.createArgument().setValue(COMMAND_MKLBTYPE);
    9
    checkOptions(commandLine);
    7
    checkOptions(commandLine);
    10
    if (!getFailOnErr())
    8
    if (!getFailOnErr())
    11
    getProject().log("Ignoring any errors that occur for: " + getTypeSpecifier(), Project.MSG_VERBOSE);
    9
    getProject().log("Ignoring any errors that occur for: " + getTypeSpecifier(), Project.MSG_VERBOSE);
    12
    result = run(commandLine);
    10
    result = run(commandLine);
    13
    if (Execute.isFailure(result) && getFailOnErr())
    11
    if (Execute.isFailure(result) && getFailOnErr())
    14
    String msg = "Failed executing: " + commandLine.toString();
    12
    String msg = "Failed executing: " + commandLine.toString();
    15
    throw new BuildException(msg, getLocation());
    13
    throw new BuildException(msg, getLocation());
    Precondition Violations (1)
    Row Violation
    1Unmatched throw new BuildException("Required attribute TypeName not specified");