setBoolean(POLLING_ENABLED_PATH, null, poll); if (old != poll) { for (Iterator it = observers.iterator(); it.hasNext();) ((OptionsObserver) it.next()).pollingStateChanged(poll); }
setInteger(POLLING_INTERVAL_PATH, null, interval); if (old != interval) { for (Iterator it = observers.iterator(); it.hasNext();) ((OptionsObserver) it.next()).pollingIntervalChanged(interval); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/scripting/config/Options.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/scripting/config/Options.java
Method name: void setPollingEnabled(boolean) Method name: void setPollInterval(int)
Number of AST nodes: 4 Number of AST nodes: 4
1
setBoolean(POLLING_ENABLED_PATH, null, poll);
1
setInteger(POLLING_INTERVAL_PATH, null, interval);
2
        if (old != poll)
2
        if (old != interval)
3
        {
3
        {
4
            for (Iterator it = observers.iterator(); it.hasNext();)
4
            for (Iterator it = observers.iterator(); it.hasNext();)
5
                ((OptionsObserver) it.next()).pollingStateChanged(poll);
5
                ((OptionsObserver) it.next()).pollingIntervalChanged(interval);
6
        }
6
        }
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.3
Clones locationClones are declared in the same class
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)13.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                          
    2
    setInteger(POLLING_INTERVAL_PATH, null, interval);
    2
    setBoolean(POLLING_ENABLED_PATH, null, poll);
                                                                                                
    3
    if (old != poll)
    3
    if (old != poll)
    3
    if (old != interval)
    Differences
    Expression1Expression2Difference
    booleanintVARIABLE_TYPE_MISMATCH
    pollintervalVARIABLE_NAME_MISMATCH
    booleanintVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable old does not match with type int of variable old
    Type boolean of variable poll does not match with type int of variable interval
    3
    if (old != interval)
    4
    for (Iterator it = observers.iterator(); it.hasNext(); )
    4
    for (Iterator it = observers.iterator(); it.hasNext(); )
                                                                                                                                      
    5
    ((OptionsObserver)it.next()).pollingIntervalChanged(interval);
    Preondition Violations
    Unmatched statement ((OptionsObserver)it.next()).pollingIntervalChanged(interval); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    ((OptionsObserver)it.next()).pollingIntervalChanged(interval);
    5
    ((OptionsObserver)it.next()).pollingStateChanged(poll);
    5
    ((OptionsObserver)it.next()).pollingStateChanged(poll);
    Preondition Violations
    Unmatched statement ((OptionsObserver)it.next()).pollingStateChanged(poll); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                        
    Precondition Violations (4)
    Row Violation
    1Type boolean of variable old does not match with type int of variable old
    2Type boolean of variable poll does not match with type int of variable interval
    3Unmatched statement ((OptionsObserver)it.next()).pollingIntervalChanged(interval); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement ((OptionsObserver)it.next()).pollingStateChanged(poll); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted