if (event.getValueIsAdjusting()) {
return;
}
FocusOwner focusOwner = FocusManager.getInstance().getCurrentOwner();
TableController table = ((AddressbookFrameMediator) frameMediator)
.getTable();
if (table.equals(focusOwner)) {
// table has focus
Object[] uids = ((AddressbookFrameMediator) frameMediator)
.getTable().getUids();
if (uids.length > 0) {
setEnabled(true);
return;
}
}
setEnabled(false);
if (event.getValueIsAdjusting()) {
return;
}
FocusOwner focusOwner = FocusManager.getInstance().getCurrentOwner();
TableController table = ((AddressbookFrameMediator) frameMediator)
.getTable();
if (table.equals(focusOwner)) {
// table has focus
Object[] uids = ((AddressbookFrameMediator) frameMediator)
.getTable().getUids();
if (uids.length > 0) {
setEnabled(true);
return;
}
}
setEnabled(false);
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 valueChanged(ListSelectionEvent)
|
|
Method name: void valueChanged(ListSelectionEvent)
|
Number of AST nodes: 10
|
|
Number of AST nodes: 10
|
|
1 | if (event.getValueIsAdjusting()) {↵ | | 1 | if (event.getValueIsAdjusting()) {↵
|
2 | return;↵ | | 2 | return;↵
|
3 | }↵ | | 3 | }↵
|
|
4 | FocusOwner focusOwner = FocusManager.getInstance().getCurrentOwner();↵ | | 4 | FocusOwner focusOwner = FocusManager.getInstance().getCurrentOwner();↵
|
|
5 | TableController table = ((AddressbookFrameMediator) frameMediator)↵ | | 5 | TableController table = ((AddressbookFrameMediator) frameMediator)↵
|
6 | .getTable();↵ | | 6 | .getTable();↵
|
|
7 | if (table.equals(focusOwner)) {↵ | | 7 | if (table.equals(focusOwner)) {↵
|
|
8 | // table has focus↵ | | 8 | // table has focus↵
|
|
9 | Object[] uids = ((AddressbookFrameMediator) frameMediator)↵ | | 9 | Object[] uids = ((AddressbookFrameMediator) frameMediator)↵
|
10 | .getTable().getUids();↵ | | 10 | .getTable().getUids();↵
|
|
11 | if (uids.length > 0) {↵ | | 11 | if (uids.length > 0) {↵
|
12 | setEnabled(true);↵ | | 12 | setEnabled(true);↵
|
13 | return;↵ | | 13 | return;↵
|
14 | }↵ | | 14 | }↵
|
15 | }↵ | | 15 | }↵
|
|
16 | setEnabled(false); | | 16 | setEnabled(false);
|
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.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 26 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 10 |
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) | 1.3 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (event.getValueIsAdjusting()) | | 1 | if (event.getValueIsAdjusting()) |
2 | | | 2 | |
3 | FocusOwner focusOwner = FocusManager.getInstance().getCurrentOwner(); | | 3 | FocusOwner focusOwner = FocusManager.getInstance().getCurrentOwner(); |
4 | TableController table = ((AddressbookFrameMediator)frameMediator).getTable(); | | 4 | TableController table = ((AddressbookFrameMediator)frameMediator).getTable(); |
5 | if (table.equals(focusOwner)) | | 5 | if (table.equals(focusOwner)) |
6 | Object[] uids = ((AddressbookFrameMediator)frameMediator).getTable().getUids(); | | 6 | Object[] uids = ((AddressbookFrameMediator)frameMediator).getTable().getUids(); |
7 | | | 7 | |
8 | | | 8 | |
9 | | | 9 | |
10 | setEnabled(false); | | 10 | setEnabled(false); |
Precondition Violations (0)
Row |
Violation |