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());
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());
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/CCCheckin.java
Method name: void checkOptions(Commandline) Method name: void checkOptions(Commandline)
Number of AST nodes: 13 Number of AST nodes: 14
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 (getIdentical()) {
12
        if (getNoWarn()) {
13
            // -identical
13
            // -nwarn
14
            cmd.createArgument().setValue(FLAG_IDENTICAL);
14
            cmd.createArgument().setValue(FLAG_NOWARN);
15
        }
15
        }
16
       if (getFull()) {
16
        if (getPreserveTime()) {
17
           // -full
17
            // -
18
ptime
18
           cmd.createArgument().setValue(FLAG_FULL);
19
            cmd.createArgument().setValue(FLAG_
19
       } else
20
PRESERVETIME);
21
        }
20
 {
22
        if (getKeepCopy()) {
21
           // -incremental
23
            // -
24
keep
22
           cmd.createArgument().setValue(FLAG_INCREMENTAL);
25
            cmd.createArgument().setValue(FLAG_KEEPCOPY);
23
       }
26
        }
24
       if (getNlabel()) {
27
        if (getIdentical()) {
25
           // -nlabel
28
            // -identical
26
           cmd.createArgument().setValue(FLAG_NLABEL);
29
            cmd.createArgument().setValue(FLAG_IDENTICAL);
27
       }
30
        }
28
       // baseline_root_name
31
        // viewpath
29
        cmd.createArgument().setValue(getBaselineRootName());
32
        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)0.6
Clones locationClones are in different classes having the same super class
Number of node comparisons60
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements11
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)6.9
    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 (getIdentical())
    6
    if (getIdentical())
    6
    if (getNoWarn())
    Differences
    Expression1Expression2Difference
    getIdenticalgetNoWarnMETHOD_INVOCATION_NAME_MISMATCH
    6
    if (getNoWarn())
    7
    cmd.createArgument().setValue(FLAG_IDENTICAL);
    7
    cmd.createArgument().setValue(FLAG_IDENTICAL);
    7
    cmd.createArgument().setValue(FLAG_NOWARN);
    Differences
    Expression1Expression2Difference
    FLAG_IDENTICALFLAG_NOWARNVARIABLE_NAME_MISMATCH
    7
    cmd.createArgument().setValue(FLAG_NOWARN);
    8
    if (getFull())
    8
    if (getFull())
    8
    if (getPreserveTime())
    Differences
    Expression1Expression2Difference
    getFullgetPreserveTimeMETHOD_INVOCATION_NAME_MISMATCH
    8
    if (getPreserveTime())
    9
    cmd.createArgument().setValue(FLAG_FULL);
    9
    cmd.createArgument().setValue(FLAG_FULL);
    9
    cmd.createArgument().setValue(FLAG_PRESERVETIME);
    Differences
    Expression1Expression2Difference
    FLAG_FULLFLAG_PRESERVETIMEVARIABLE_NAME_MISMATCH
    9
    cmd.createArgument().setValue(FLAG_PRESERVETIME);
    else
            
    10
    cmd.createArgument().setValue(FLAG_INCREMENTAL);
    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
                                                                                                            
    11
    if (getNlabel())
    11
    if (getNlabel())
    10
    if (getKeepCopy())
    Differences
    Expression1Expression2Difference
    getNlabelgetKeepCopyMETHOD_INVOCATION_NAME_MISMATCH
    10
    if (getKeepCopy())
    12
    cmd.createArgument().setValue(FLAG_NLABEL);
    12
    cmd.createArgument().setValue(FLAG_NLABEL);
    11
    cmd.createArgument().setValue(FLAG_KEEPCOPY);
    Differences
    Expression1Expression2Difference
    FLAG_NLABELFLAG_KEEPCOPYVARIABLE_NAME_MISMATCH
    11
    cmd.createArgument().setValue(FLAG_KEEPCOPY);
    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