if (getCommentFile() != null) { /* Had to make two separate commands here because if a space is inserted between the flag and the value, it is treated as a Windows filename with a space and it is enclosed in double quotes ("). This breaks clearcase. */ cmd.createArgument().setValue(FLAG_COMMENTFILE); cmd.createArgument().setValue(getCommentFile()); }
if (getVersion() != null) { /* Had to make two separate commands here because if a space is inserted between the flag and the value, it is treated as a Windows filename with a space and it is enclosed in double quotes ("). This breaks clearcase. */ cmd.createArgument().setValue(FLAG_VERSION); cmd.createArgument().setValue(getVersion()); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/clearcase/CCMklabel.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/clearcase/CCMkattr.java
Method name: void getCommentFileCommand(Commandline) Method name: void getVersionCommand(Commandline)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (getCommentFile() != null) {
1
if (getVersion() != null) {
2
            /* Had to make two separate commands here because if a space is
2
            /* Had to make two separate commands here because if a space is
3
               inserted between the flag and the value, it is treated as a
3
               inserted between the flag and the value, it is treated as a
4
               Windows filename with a space and it is enclosed in double
4
               Windows filename with a space and it is enclosed in double
5
               quotes ("). This breaks clearcase.
5
               quotes ("). This breaks clearcase.
6
            */
6
            */
7
            cmd.createArgument().setValue(FLAG_COMMENTFILE);
7
            cmd.createArgument().setValue(FLAG_VERSION);
8
            cmd.createArgument().setValue(getCommentFile());
8
            cmd.createArgument().setValue(getVersion());
9
        }
9
        }
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.3
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)2.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (getCommentFile() != null)
    1
    if (getCommentFile() != null)
    1
    if (getVersion() != null)
    Differences
    Expression1Expression2Difference
    getCommentFilegetVersionMETHOD_INVOCATION_NAME_MISMATCH
    1
    if (getVersion() != null)
    2
    cmd.createArgument().setValue(FLAG_COMMENTFILE);
    2
    cmd.createArgument().setValue(FLAG_COMMENTFILE);
    2
    cmd.createArgument().setValue(FLAG_VERSION);
    Differences
    Expression1Expression2Difference
    FLAG_COMMENTFILEFLAG_VERSIONVARIABLE_NAME_MISMATCH
    2
    cmd.createArgument().setValue(FLAG_VERSION);
    3
    cmd.createArgument().setValue(getCommentFile());
    3
    cmd.createArgument().setValue(getCommentFile());
    3
    cmd.createArgument().setValue(getVersion());
    Differences
    Expression1Expression2Difference
    getCommentFilegetVersionMETHOD_INVOCATION_NAME_MISMATCH
    3
    cmd.createArgument().setValue(getVersion());
    Precondition Violations (0)
    Row Violation