list.addMouseListener(new DoubleClickListener() { @Override public void doubleClick(MouseEvent event) { IEventInfo selected = (IEventInfo) list.getSelectedValue(); openEditCalendarEventDialog(selected); } }); list.add(getPopupMenu()); list.addMouseListener(new MyMouseListener());
list.addMouseListener(new DoubleClickListener() { @Override public void doubleClick(MouseEvent event) { IContactModelPartial selected = (IContactModelPartial) list .getSelectedValue(); openEditContactDialog(selected); } }); list.add(getPopupMenu()); list.addMouseListener(new MyMouseListener());
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: void CalendarBox() Method name: void ContactBox()
Number of AST nodes: 3 Number of AST nodes: 3
1
list.addMouseListener(new DoubleClickListener() {
1
list.addMouseListener(new DoubleClickListener() {
2
			@Override
2
			@Override
3
			public void doubleClick(MouseEvent event) {
3
			public void doubleClick(MouseEvent event) {
4
				IEventInfo selected = (IEventInfo) list
4
				IContactModelPartial selected = (IContactModelPartial) list
5
.getSelectedValue();
5
						.getSelectedValue();
6
				openEditCalendarEventDialog(selected);
6
				openEditContactDialog(selected);
7
			}
7
			}
8
		});
8
		});
9
		list.add(getPopupMenu());
9
		list.add(getPopupMenu());
10
		list.addMouseListener(new MyMouseListener());
10
		list.addMouseListener(new MyMouseListener());
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 comparisons9
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    14
    list.addMouseListener(new DoubleClickListener() {...});
    Preondition Violations
    Unmatched statement list.addMouseListener(new DoubleClickListener(){ @Override public void doubleClick( MouseEvent 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
    14
    list.addMouseListener(new DoubleClickListener() {...});
    13
    list.addMouseListener(new DoubleClickListener() {...});
    13
    list.addMouseListener(new DoubleClickListener() {...});
    16
    list.addMouseListener(new MyMouseListener());
    Differences
    Expression1Expression2Difference
    org.columba.core.gui.base.DoubleClickListenerorg.columba.contact.gui.box.ContactBox.MyMouseListenerSUBCLASS_TYPE_MISMATCH
    org.columba.calendar.ui.box.CalendarListorg.columba.contact.gui.box.ContactListSUBCLASS_TYPE_MISMATCH
    16
    list.addMouseListener(new MyMouseListener());
    14
    list.add(getPopupMenu());
    14
    list.add(getPopupMenu());
    Preondition Violations
    Unmatched statement list.add(getPopupMenu()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                              
                                                              
    15
    list.add(getPopupMenu());
    Preondition Violations
    Unmatched statement list.add(getPopupMenu()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    15
    list.add(getPopupMenu());
    15
    list.addMouseListener(new MyMouseListener());
    15
    list.addMouseListener(new MyMouseListener());
    Preondition Violations
    Unmatched statement list.addMouseListener(new MyMouseListener()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                      
    Precondition Violations (4)
    Row Violation
    1Unmatched statement list.addMouseListener(new DoubleClickListener(){ @Override public void doubleClick( MouseEvent 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 list.add(getPopupMenu()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement list.add(getPopupMenu()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement list.addMouseListener(new MyMouseListener()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted