if (errC != null) { errColor = PREFIX + errC + SUFFIX; } if (warn != null) { warnColor = PREFIX + warn + SUFFIX; } if (info != null) { infoColor = PREFIX + info + SUFFIX; } if (verbose != null) { verboseColor = PREFIX + verbose + SUFFIX; }
if (warn != null) { warnColor = PREFIX + warn + SUFFIX; } if (info != null) { infoColor = PREFIX + info + SUFFIX; } if (verbose != null) { verboseColor = PREFIX + verbose + SUFFIX; } if (debug != null) { debugColor = PREFIX + debug + SUFFIX; }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/listener/AnsiColorLogger.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/listener/AnsiColorLogger.java
Method name: void setColors() Method name: void setColors()
Number of AST nodes: 8 Number of AST nodes: 8
1
if (errC != null) {
2
                errColor = PREFIX + errC + SUFFIX;
3
            }
4
            if (warn != null) {
1
if (warn != null) {
5
                warnColor = PREFIX + warn + SUFFIX;
2
                warnColor = PREFIX + warn + SUFFIX;
6
            }
3
            }
7
            if (info != null) {
4
            if (info != null) {
8
                infoColor = PREFIX + info + SUFFIX;
5
                infoColor = PREFIX + info + SUFFIX;
9
            }
6
            }
10
            if (verbose != null) {
7
            if (verbose != null) {
11
                verboseColor = PREFIX + verbose + SUFFIX;
8
                verboseColor = PREFIX + verbose + SUFFIX;
12
            }
9
            }
10
            if (debug != null) {
11
                debugColor = PREFIX + debug + SUFFIX;
12
            }
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.8
Clones locationClones are in the same method
Number of node comparisons47
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    16
    if (errC != null)
    16
    if (errC != null)
    18
    if (warn != null)
    Differences
    Expression1Expression2Difference
    errCwarnVARIABLE_NAME_MISMATCH
    18
    if (warn != null)
    17
    errColor = PREFIX + errC + SUFFIX;
    17
    errColor = PREFIX + errC + SUFFIX;
    19
    warnColor = PREFIX + warn + SUFFIX;
    Differences
    Expression1Expression2Difference
    errColorwarnColorVARIABLE_NAME_MISMATCH
    errCwarnVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression errColor is a field being modified, and thus it cannot be parameterized
    Expression warnColor is a field being modified, and thus it cannot be parameterized
    19
    warnColor = PREFIX + warn + SUFFIX;
    18
    if (warn != null)
    18
    if (warn != null)
    20
    if (info != null)
    Differences
    Expression1Expression2Difference
    warninfoVARIABLE_NAME_MISMATCH
    20
    if (info != null)
    19
    warnColor = PREFIX + warn + SUFFIX;
    19
    warnColor = PREFIX + warn + SUFFIX;
    21
    infoColor = PREFIX + info + SUFFIX;
    Differences
    Expression1Expression2Difference
    warnColorinfoColorVARIABLE_NAME_MISMATCH
    warninfoVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression warnColor is a field being modified, and thus it cannot be parameterized
    Expression infoColor is a field being modified, and thus it cannot be parameterized
    21
    infoColor = PREFIX + info + SUFFIX;
    20
    if (info != null)
    20
    if (info != null)
    22
    if (verbose != null)
    Differences
    Expression1Expression2Difference
    infoverboseVARIABLE_NAME_MISMATCH
    22
    if (verbose != null)
    21
    infoColor = PREFIX + info + SUFFIX;
    21
    infoColor = PREFIX + info + SUFFIX;
    23
    verboseColor = PREFIX + verbose + SUFFIX;
    Differences
    Expression1Expression2Difference
    infoColorverboseColorVARIABLE_NAME_MISMATCH
    infoverboseVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression infoColor is a field being modified, and thus it cannot be parameterized
    Expression verboseColor is a field being modified, and thus it cannot be parameterized
    23
    verboseColor = PREFIX + verbose + SUFFIX;
    22
    if (verbose != null)
    22
    if (verbose != null)
    24
    if (debug != null)
    Differences
    Expression1Expression2Difference
    verbosedebugVARIABLE_NAME_MISMATCH
    24
    if (debug != null)
    23
    verboseColor = PREFIX + verbose + SUFFIX;
    23
    verboseColor = PREFIX + verbose + SUFFIX;
    25
    debugColor = PREFIX + debug + SUFFIX;
    Differences
    Expression1Expression2Difference
    verboseColordebugColorVARIABLE_NAME_MISMATCH
    verbosedebugVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression verboseColor is a field being modified, and thus it cannot be parameterized
    Expression debugColor is a field being modified, and thus it cannot be parameterized
    25
    debugColor = PREFIX + debug + SUFFIX;
    Precondition Violations (8)
    Row Violation
    1Expression errColor is a field being modified, and thus it cannot be parameterized
    2Expression warnColor is a field being modified, and thus it cannot be parameterized
    3Expression warnColor is a field being modified, and thus it cannot be parameterized
    4Expression infoColor is a field being modified, and thus it cannot be parameterized
    5Expression infoColor is a field being modified, and thus it cannot be parameterized
    6Expression verboseColor is a field being modified, and thus it cannot be parameterized
    7Expression verboseColor is a field being modified, and thus it cannot be parameterized
    8Expression debugColor is a field being modified, and thus it cannot be parameterized