if (errC != null) { errColor = PREFIX + errC + SUFFIX; } if (warn != null) { warnColor = PREFIX + warn + SUFFIX; } if (info != null) { infoColor = PREFIX + info + 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: 6 Number of AST nodes: 6
1
if (errC != null) {
1
if (info != null) {
2
                errColor = PREFIX + errC + SUFFIX;
2
                infoColor = PREFIX + info + SUFFIX;
3
            }
3
            }
4
            if (warn != null) {
4
            if (verbose != null) {
5
                warnColor = PREFIX + warn + SUFFIX;
5
                verboseColor = PREFIX + verbose + SUFFIX;
6
            }
6
            }
7
            if (info != null) {
7
            if (debug != null) {
8
                infoColor = PREFIX + info + SUFFIX;
8
                debugColor = PREFIX + debug + SUFFIX;
9
            }
9
            }
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.0
Clones locationClones are in the same method
Number of node comparisons28
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    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.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    16
    if (errC != null)
    16
    if (errC != null)
    20
    if (info != null)
    Differences
    Expression1Expression2Difference
    errCinfoVARIABLE_NAME_MISMATCH
    20
    if (info != null)
    17
    errColor = PREFIX + errC + SUFFIX;
    17
    errColor = PREFIX + errC + SUFFIX;
    21
    infoColor = PREFIX + info + SUFFIX;
    Differences
    Expression1Expression2Difference
    errColorinfoColorVARIABLE_NAME_MISMATCH
    errCinfoVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression errColor 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;
    18
    if (warn != null)
    18
    if (warn != null)
    22
    if (verbose != null)
    Differences
    Expression1Expression2Difference
    warnverboseVARIABLE_NAME_MISMATCH
    22
    if (verbose != null)
    19
    warnColor = PREFIX + warn + SUFFIX;
    19
    warnColor = PREFIX + warn + SUFFIX;
    23
    verboseColor = PREFIX + verbose + SUFFIX;
    Differences
    Expression1Expression2Difference
    warnColorverboseColorVARIABLE_NAME_MISMATCH
    warnverboseVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression warnColor 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;
    20
    if (info != null)
    20
    if (info != null)
    24
    if (debug != null)
    Differences
    Expression1Expression2Difference
    infodebugVARIABLE_NAME_MISMATCH
    24
    if (debug != null)
    21
    infoColor = PREFIX + info + SUFFIX;
    21
    infoColor = PREFIX + info + SUFFIX;
    25
    debugColor = PREFIX + debug + SUFFIX;
    Differences
    Expression1Expression2Difference
    infoColordebugColorVARIABLE_NAME_MISMATCH
    infodebugVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression infoColor 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 (6)
    Row Violation
    1Expression errColor is a field being modified, and thus it cannot be parameterized
    2Expression infoColor 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 verboseColor 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 debugColor is a field being modified, and thus it cannot be parameterized