if (getComment() != null) { // -c getCommentCommand(cmd); } else { if (getCommentFile() != null) { // -cfile getCommentFileCommand(cmd); } else { cmd.createArgument().setValue(FLAG_NOCOMMENT); } } if (getNoWarn()) { // -nwarn cmd.createArgument().setValue(FLAG_NOWARN); } if (getPreserveTime()) { // -ptime cmd.createArgument().setValue(FLAG_PRESERVETIME); } if (getKeepCopy()) { // -keep cmd.createArgument().setValue(FLAG_KEEPCOPY); } if (getIdentical()) { // -identical cmd.createArgument().setValue(FLAG_IDENTICAL); } // viewpath cmd.createArgument().setValue(getViewPath());
if (getComment() != null) { // -c getCommentCommand(cmd); } else { if (getCommentFile() != null) { // -cfile getCommentFileCommand(cmd); } else { cmd.createArgument().setValue(FLAG_NOCOMMENT); } } if (getIdentical()) { // -identical cmd.createArgument().setValue(FLAG_IDENTICAL); } if (getFull()) { // -full cmd.createArgument().setValue(FLAG_FULL); } else { // -incremental cmd.createArgument().setValue(FLAG_INCREMENTAL); } if (getNlabel()) { // -nlabel cmd.createArgument().setValue(FLAG_NLABEL); } // baseline_root_name cmd.createArgument().setValue(getBaselineRootName());
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/clearcase/CCCheckin.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/clearcase/CCMkbl.java
Method name: void checkOptions(Commandline) Method name: void checkOptions(Commandline)
Number of AST nodes: 14 Number of AST nodes: 13
1
if (getComment() != null) {
1
if (getComment() != null) {
2
            // -c
2
            // -c
3
            getCommentCommand(cmd);
3
            getCommentCommand(cmd);
4
        } else {
4
        } else {
5
            if (getCommentFile() != null) {
5
            if (getCommentFile() != null) {
6
                // -cfile
6
                // -cfile
7
                getCommentFileCommand(cmd);
7
                getCommentFileCommand(cmd);
8
            } else {
8
            } else {
9
                cmd.createArgument().setValue(FLAG_NOCOMMENT);
9
                cmd.createArgument().setValue(FLAG_NOCOMMENT);
10
            }
10
            }
11
        }
11
        }
12
        if (getNoWarn()) {
12
        if (getIdentical()) {
13
            // -nwarn
13
            // -identical
14
            cmd.createArgument().setValue(FLAG_NOWARN);
14
            cmd.createArgument().setValue(FLAG_IDENTICAL);
15
        }
15
        }
16
        if (getPreserveTime()) {
16
       if (getFull()) {
17
            // -ptime
17
           // -
18
 
18
full
19
           cmd.createArgument().setValue(FLAG_PRESERVETIME);
19
           cmd.createArgument().setValue(FLAG_
20
        }
21
        if (getKeepCopy())
20
FULL);
22
 {
21
       } else {
23
            // -keep
22
           // -
24
 
23
incremental
25
           cmd.createArgument().setValue(FLAG_KEEPCOPY);
24
           cmd.createArgument().setValue(FLAG_INCREMENTAL);
26
        }
25
       }
27
        if (getIdentical()) {
26
       if (getNlabel()) {
28
            // -identical
27
           // -nlabel
29
            cmd.createArgument().setValue(FLAG_IDENTICAL);
28
           cmd.createArgument().setValue(FLAG_NLABEL);
30
        }
29
       }
31
        // viewpath
30
       // baseline_root_name
32
        cmd.createArgument().setValue(getViewPath());
31
        cmd.createArgument().setValue(getBaselineRootName());
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.9
Clones locationClones are in different classes having the same super class
Number of node comparisons65
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements11
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)13.1
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (getComment() != null)
    1
    if (getComment() != null)
    2
    getCommentCommand(cmd);
    2
    getCommentCommand(cmd);
    else
    else
    3
    if (getCommentFile() != null)
    3
    if (getCommentFile() != null)
    4
    getCommentFileCommand(cmd);
    4
    getCommentFileCommand(cmd);
    else
    else
    5
    cmd.createArgument().setValue(FLAG_NOCOMMENT);
    5
    cmd.createArgument().setValue(FLAG_NOCOMMENT);
    6
    if (getNoWarn())
    6
    if (getNoWarn())
    6
    if (getIdentical())
    Differences
    Expression1Expression2Difference
    getNoWarngetIdenticalMETHOD_INVOCATION_NAME_MISMATCH
    6
    if (getIdentical())
    7
    cmd.createArgument().setValue(FLAG_NOWARN);
    7
    cmd.createArgument().setValue(FLAG_NOWARN);
    7
    cmd.createArgument().setValue(FLAG_IDENTICAL);
    Differences
    Expression1Expression2Difference
    FLAG_NOWARNFLAG_IDENTICALVARIABLE_NAME_MISMATCH
    7
    cmd.createArgument().setValue(FLAG_IDENTICAL);
    8
    if (getPreserveTime())
    8
    if (getPreserveTime())
    8
    if (getFull())
    Differences
    Expression1Expression2Difference
    getPreserveTimegetFullMETHOD_INVOCATION_NAME_MISMATCH
    8
    if (getFull())
    9
    cmd.createArgument().setValue(FLAG_PRESERVETIME);
    9
    cmd.createArgument().setValue(FLAG_PRESERVETIME);
    9
    cmd.createArgument().setValue(FLAG_FULL);
    Differences
    Expression1Expression2Difference
    FLAG_PRESERVETIMEFLAG_FULLVARIABLE_NAME_MISMATCH
    9
    cmd.createArgument().setValue(FLAG_FULL);
            
    else
                                                                                                            
    10
    cmd.createArgument().setValue(FLAG_INCREMENTAL);
    Preondition Violations
    Unmatched statement cmd.createArgument().setValue(FLAG_INCREMENTAL); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    10
    cmd.createArgument().setValue(FLAG_INCREMENTAL);
    10
    if (getKeepCopy())
    10
    if (getKeepCopy())
    11
    if (getNlabel())
    Differences
    Expression1Expression2Difference
    getKeepCopygetNlabelMETHOD_INVOCATION_NAME_MISMATCH
    11
    if (getNlabel())
    11
    cmd.createArgument().setValue(FLAG_KEEPCOPY);
    11
    cmd.createArgument().setValue(FLAG_KEEPCOPY);
    12
    cmd.createArgument().setValue(FLAG_NLABEL);
    Differences
    Expression1Expression2Difference
    FLAG_KEEPCOPYFLAG_NLABELVARIABLE_NAME_MISMATCH
    12
    cmd.createArgument().setValue(FLAG_NLABEL);
    Precondition Violations (1)
    Row Violation
    1Unmatched statement cmd.createArgument().setValue(FLAG_INCREMENTAL); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted