if (isStarted) { Logger log = Logger.getLogger("org.columba"); log.removeHandler(this); isStarted = false; }
if (!isStarted) { Logger log = Logger.getLogger("org.columba"); log.addHandler(this); isStarted = true; }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/plugins/org.columba.core.LogDisplay/src/org/columba/core/gui/logdisplay/LogRecordList.java File path: /columba-1.4-src/plugins/org.columba.core.LogDisplay/src/org/columba/core/gui/logdisplay/LogRecordList.java
Method name: void stopLogging() Method name: void startLogging()
Number of AST nodes: 4 Number of AST nodes: 4
1
if (isStarted) {
1
if (!isStarted) {
2
            Logger log = Logger.getLogger("org.columba");
2
            Logger log = Logger.getLogger("org.columba");
3
            log.removeHandler(this);
3
            log.addHandler(this);
4
            isStarted = false;
4
            isStarted = true;
5
        }
5
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are declared in the same class
Number of node comparisons16
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    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.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (isStarted)
    1
    if (isStarted)
    1
    if (!isStarted)
    Differences
    Expression1Expression2Difference
    isStarted!isStartedTYPE_COMPATIBLE_REPLACEMENT
    1
    if (!isStarted)
    2
    Logger log = Logger.getLogger("org.columba");
    2
    Logger log = Logger.getLogger("org.columba");
    3
    log.removeHandler(this);
    3
    log.removeHandler(this);
    3
    log.addHandler(this);
    Differences
    Expression1Expression2Difference
    removeHandleraddHandlerMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression log.removeHandler(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression log.addHandler(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression log.removeHandler(this) is a void method call, and thus it cannot be parameterized
    Expression log.addHandler(this) is a void method call, and thus it cannot be parameterized
    3
    log.addHandler(this);
    4
    isStarted = false;
    4
    isStarted = false;
    4
    isStarted = true;
    Differences
    Expression1Expression2Difference
    falsetrueLITERAL_VALUE_MISMATCH
    4
    isStarted = true;
    Precondition Violations (4)
    Row Violation
    1Expression log.removeHandler(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression log.addHandler(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression log.removeHandler(this) is a void method call, and thus it cannot be parameterized
    4Expression log.addHandler(this) is a void method call, and thus it cannot be parameterized