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 setPollInterval(int)
|
Method name: void setPollingEnabled(boolean)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
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 != interval)↵ | 3 | if (old != poll)↵ | |
4 | {↵ | 4 | {↵ | |
5 | for (Iterator it = observers.iterator(); it.hasNext();)↵ | 5 | for (Iterator it = observers.iterator(); it.hasNext();)↵ | |
6 | ((OptionsObserver) it.next()).pollingIntervalChanged(interval);↵ | 6 | ((OptionsObserver) it.next()).pollingStateChanged(poll);↵ | |
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) | 12.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 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 != interval) |
| 3 | if (old != poll) | ||||||||||||||||||
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); |
| |
Row | Violation |
---|---|
1 | Type int of variable old does not match with type boolean of variable old |
2 | Type int of variable interval does not match with type boolean of variable poll |
3 | 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 |
4 | 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 |