AddressbookFrameMediator mediator = (AddressbookFrameMediator) frameMediator;
FocusOwner focusOwner = FocusManager.getInstance().getCurrentOwner();
TableController table = ((AddressbookFrameMediator) frameMediator)
.getTable();
boolean tableHasFocus = false;
if (table.equals(focusOwner))
tableHasFocus = true;
AddressbookFrameMediator mediator = (AddressbookFrameMediator) frameMediator;
FocusOwner focusOwner = FocusManager.getInstance().getCurrentOwner();
TableController table = ((AddressbookFrameMediator) frameMediator)
.getTable();
boolean tableHasFocus = false;
if (table.equals(focusOwner))
tableHasFocus = true;
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/action/EditPropertiesAction.java
|
|
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/action/RemoveCardAction.java
|
Method name: void actionPerformed(ActionEvent)
|
|
Method name: void actionPerformed(ActionEvent)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | AddressbookFrameMediator mediator = (AddressbookFrameMediator) frameMediator;↵ | | 1 | AddressbookFrameMediator mediator = (AddressbookFrameMediator) frameMediator;↵
|
|
2 | FocusOwner focusOwner = FocusManager.getInstance().getCurrentOwner();↵ | | 2 | FocusOwner focusOwner = FocusManager.getInstance().getCurrentOwner();↵
|
|
3 | TableController table = ((AddressbookFrameMediator) frameMediator)↵ | | 3 | TableController table = ((AddressbookFrameMediator) frameMediator)↵
|
4 | .getTable();↵ | | 4 | .getTable();↵
|
|
5 | boolean tableHasFocus = false;↵ | | 5 | boolean tableHasFocus = false;↵
|
6 | if (table.equals(focusOwner))↵ | | 6 | if (table.equals(focusOwner))↵
|
7 | tableHasFocus = true; | | 7 | tableHasFocus = true;
|
See real code fragment |
|
See real code fragment |
Summary
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.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 20 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 6 |
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.8 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | AddressbookFrameMediator mediator = (AddressbookFrameMediator)frameMediator; | | 1 | AddressbookFrameMediator mediator = (AddressbookFrameMediator)frameMediator; |
2 | FocusOwner focusOwner = FocusManager.getInstance().getCurrentOwner(); | | 2 | FocusOwner focusOwner = FocusManager.getInstance().getCurrentOwner(); |
3 | TableController table = ((AddressbookFrameMediator)frameMediator).getTable(); | | 3 | TableController table = ((AddressbookFrameMediator)frameMediator).getTable(); |
4 | boolean tableHasFocus = false; | | 4 | boolean tableHasFocus = false; |
5 | if (table.equals(focusOwner)) | | 5 | if (table.equals(focusOwner)) |
6 | | | 6 | |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables tableHasFocus, mediator , while Clone fragment #2 returns variables tableHasFocus, mediator |