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);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are in different classes having the same super class
Number of node comparisons4
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
    5
    item.addActionListener(new ActionListener() {...});
    Preondition Violations
    Unmatched statement item.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent event){ IContactModelPartial selected=(IContactModelPartial)list.getSelectedValue(); openEditContactDialog(selected); } } ); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5
    item.addActionListener(new ActionListener() {...});
    5
    item.addActionListener(new ActionListener() {...});
    5
    item.addActionListener(new ActionListener() {...});
    Preondition Violations
    Unmatched statement item.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent event){ IEventInfo selected=(IEventInfo)list.getSelectedValue(); openEditCalendarEventDialog(selected); } } ); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                                                                                                                                                                                                                                                                                                            
    6
    contextMenu.add(item);
    6
    contextMenu.add(item);
    Precondition Violations (2)
    Row Violation
    1Unmatched statement item.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent event){ IContactModelPartial selected=(IContactModelPartial)list.getSelectedValue(); openEditContactDialog(selected); } } ); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement item.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent event){ IEventInfo selected=(IEventInfo)list.getSelectedValue(); openEditCalendarEventDialog(selected); } } ); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted