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 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 6 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 13.0 |
Clone type | Type 2 |
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 != interval) | ||||||||||||||||||
4 | for (Iterator it = observers.iterator(); it.hasNext(); ) | 4 | for (Iterator it = observers.iterator(); it.hasNext(); ) | |||||||||||||||||||
|
| 5 | ((OptionsObserver)it.next()).pollingIntervalChanged(interval); | |||||||||||||||||||
5 | ((OptionsObserver)it.next()).pollingStateChanged(poll); |
| |
Row | Violation |
---|---|
1 | Type boolean of variable old does not match with type int of variable old |
2 | Type boolean of variable poll does not match with type int of variable interval |
3 | 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 |
4 | 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 |