item.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
IEventInfo selected = (IEventInfo) list.getSelectedValue();
openEditCalendarEventDialog(selected);
}
});
contextMenu.add(item);
item.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
IContactModelPartial selected = (IContactModelPartial) list
.getSelectedValue();
openEditContactDialog(selected);
}
});
contextMenu.add(item);
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/ui/box/CalendarBox.java
|
|
File path: /columba-1.4-src/contact/src/main/java/org/columba/contact/gui/box/ContactBox.java
|
Method name: JPopupMenu getPopupMenu()
|
|
Method name: JPopupMenu getPopupMenu()
|
Number of AST nodes: 2
|
|
Number of AST nodes: 2
|
|
1 | item.addActionListener(new ActionListener() {↵ | | 1 | item.addActionListener(new ActionListener() {↵
|
2 | public void actionPerformed(ActionEvent event) {↵ | | 2 | public void actionPerformed(ActionEvent event) {↵
|
3 | IEventInfo selected = (IEventInfo) list↵ | | 3 | IContactModelPartial selected = (IContactModelPartial) list↵
|
4 | .getSelectedValue();↵ | | 4 | .getSelectedValue();↵
|
5 | openEditCalendarEventDialog(selected);↵ | | 5 | openEditContactDialog(selected);↵
|
6 | }↵ | | 6 | }↵
|
7 | });↵ | | 7 | });↵
|
|
8 | contextMenu.add(item); | | 8 | contextMenu.add(item);
|
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.0 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 4 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
| | | 5 | item.addActionListener(new ActionListener() {...}); |
5 | item.addActionListener(new ActionListener() {...}); | | | |
6 | contextMenu.add(item); | | 6 | contextMenu.add(item); |
Precondition Violations (0)
Row |
Violation |