if (getReplace()) { // -replace cmd.createArgument().setValue(FLAG_REPLACE); } if (getRecurse()) { // -recurse cmd.createArgument().setValue(FLAG_RECURSE); } if (getVersion() != null) { // -version getVersionCommand(cmd); } if (getComment() != null) { // -c getCommentCommand(cmd); } else { if (getCommentFile() != null) { // -cfile getCommentFileCommand(cmd); } else { cmd.createArgument().setValue(FLAG_NOCOMMENT); } } if (getTypeName() != null) { // type getTypeCommand(cmd); } if (getTypeValue() != null) { // type value getTypeValueCommand(cmd); } // viewpath cmd.createArgument().setValue(getViewPath());
if (getReplace()) { // -replace cmd.createArgument().setValue(FLAG_REPLACE); } if (getRecurse()) { // -recurse cmd.createArgument().setValue(FLAG_RECURSE); } if (getVersion() != null) { // -version getVersionCommand(cmd); } if (getComment() != null) { // -c getCommentCommand(cmd); } else { if (getCommentFile() != null) { // -cfile getCommentFileCommand(cmd); } else { cmd.createArgument().setValue(FLAG_NOCOMMENT); } } if (getTypeName() != null) { // type getTypeCommand(cmd); } // viewpath cmd.createArgument().setValue(getViewPath());
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/clearcase/CCMkattr.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/clearcase/CCMklabel.java
Method name: void checkOptions(Commandline) Method name: void checkOptions(Commandline)
Number of AST nodes: 16 Number of AST nodes: 14
1
if (getReplace()) {
1
if (getReplace()) {
2
            // -replace
2
            // -replace
3
            cmd.createArgument().setValue(FLAG_REPLACE);
3
            cmd.createArgument().setValue(FLAG_REPLACE);
4
        }
4
        }
5
        if (getRecurse()) {
5
        if (getRecurse()) {
6
            // -recurse
6
            // -recurse
7
            cmd.createArgument().setValue(FLAG_RECURSE);
7
            cmd.createArgument().setValue(FLAG_RECURSE);
8
        }
8
        }
9
        if (getVersion() != null) {
9
        if (getVersion() != null) {
10
            // -version
10
            // -version
11
            getVersionCommand(cmd);
11
            getVersionCommand(cmd);
12
        }
12
        }
13
        if (getComment() != null) {
13
        if (getComment() != null) {
14
            // -c
14
            // -c
15
            getCommentCommand(cmd);
15
            getCommentCommand(cmd);
16
        } else {
16
        } else {
17
            if (getCommentFile() != null) {
17
            if (getCommentFile() != null) {
18
                // -cfile
18
                // -cfile
19
                getCommentFileCommand(cmd);
19
                getCommentFileCommand(cmd);
20
            } else {
20
            } else {
21
                cmd.createArgument().setValue(FLAG_NOCOMMENT);
21
                cmd.createArgument().setValue(FLAG_NOCOMMENT);
22
            }
22
            }
23
        }
23
        }
24
        if (getTypeName() != null) {
24
        if (getTypeName() != null) {
25
            // type
25
            // type
26
            getTypeCommand(cmd);
26
            getTypeCommand(cmd);
27
        }
27
        }
28
        if (getTypeValue() != null) {
29
            // type value
30
            getTypeValueCommand(cmd);
31
        }
32
        // viewpath
28
        // viewpath
33
        cmd.createArgument().setValue(getViewPath());
29
        cmd.createArgument().setValue(getViewPath());
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)1.5
Clones locationClones are in different classes having the same super class
Number of node comparisons85
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements14
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)8.9
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (getReplace())
    1
    if (getReplace())
    2
    cmd.createArgument().setValue(FLAG_REPLACE);
    2
    cmd.createArgument().setValue(FLAG_REPLACE);
    3
    if (getRecurse())
    3
    if (getRecurse())
    4
    cmd.createArgument().setValue(FLAG_RECURSE);
    4
    cmd.createArgument().setValue(FLAG_RECURSE);
    5
    if (getVersion() != null)
    5
    if (getVersion() != null)
    6
    getVersionCommand(cmd);
    6
    getVersionCommand(cmd);
    7
    if (getComment() != null)
    7
    if (getComment() != null)
    8
    getCommentCommand(cmd);
    8
    getCommentCommand(cmd);
    else
    else
    9
    if (getCommentFile() != null)
    9
    if (getCommentFile() != null)
    10
    getCommentFileCommand(cmd);
    10
    getCommentFileCommand(cmd);
    else
    else
    11
    cmd.createArgument().setValue(FLAG_NOCOMMENT);
    11
    cmd.createArgument().setValue(FLAG_NOCOMMENT);
    12
    if (getTypeName() != null)
    12
    if (getTypeName() != null)
    13
    getTypeCommand(cmd);
    13
    getTypeCommand(cmd);
    14
    if (getTypeValue() != null)
                                                                
    15
    getTypeValueCommand(cmd);
    15
    getTypeValueCommand(cmd);
    Preondition Violations
    Unmatched statement getTypeValueCommand(cmd); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                              
    16
    cmd.createArgument().setValue(getViewPath());
    14
    cmd.createArgument().setValue(getViewPath());
    Precondition Violations (1)
    Row Violation
    1Unmatched statement getTypeValueCommand(cmd); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted