STATUS status = object.getStatus();
if (status == STATUS.ONLINE)
setEnabled(true);
else if (status == STATUS.OFFLINE)
setEnabled(false);
STATUS status = object.getStatus();
if (status == STATUS.ONLINE)
setEnabled(false);
else if (status == STATUS.OFFLINE)
setEnabled(true);
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/plugins/org.columba.chat.altura/src/org/columba/chat/ui/action/AbstractConnectionAwareAction.java
|
|
File path: /columba-1.4-src/plugins/org.columba.chat.altura/src/org/columba/chat/ui/action/ConnectAction.java
|
Method name: void connectionChanged(ConnectionChangedEvent)
|
|
Method name: void connectionChanged(ConnectionChangedEvent)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | STATUS status = object.getStatus();↵ | | 1 | STATUS status = object.getStatus();↵
|
|
2 | if (status == STATUS.ONLINE)↵ | | 2 | if (status == STATUS.ONLINE)↵
|
3 | setEnabled(true);↵ | | 3 | setEnabled(false);↵
|
4 | else if (status == STATUS.OFFLINE)↵ | | 4 | else if (status == STATUS.OFFLINE)↵
|
5 | setEnabled(false); | | 5 | setEnabled(true);
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 14 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | STATUS status = object.getStatus(); | | 1 | STATUS status = object.getStatus(); |
2 | if (status == STATUS.ONLINE) | | 2 | if (status == STATUS.ONLINE) |
3 | | | 3 | |
4 | else if (status == STATUS.OFFLINE) | | 4 | else if (status == STATUS.OFFLINE) |
5 | | | 5 | |
Precondition Violations (0)
Row |
Violation |