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: 5 | Number of AST nodes: 5 | |||
1 | boolean old = isPollingEnabled();↵ | 1 | int old = getPollInterval();↵ | |
2 | setBoolean(POLLING_ENABLED_PATH, null, poll);↵ | 2 | setInteger(POLLING_INTERVAL_PATH, null, interval);↵ | |
3 | if (old != poll)↵ | 3 | if (old != interval)↵ | |
4 | {↵ | 4 | {↵ | |
5 | for (Iterator it = observers.iterator(); it.hasNext();)↵ | 5 | for (Iterator it = observers.iterator(); it.hasNext();)↵ | |
6 | ((OptionsObserver) it.next()).pollingStateChanged(poll);↵ | 6 | ((OptionsObserver) it.next()).pollingIntervalChanged(interval);↵ | |
7 | } | 7 |
| |
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 | 9 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 13.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | int old = getPollInterval(); | ||||||||||||||||||||
1 | boolean old = isPollingEnabled(); | | ||||||||||||||||||||
| 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 |