if ( list.getSelectedIndices().length <= 1 ) { // select new item int index = list.locationToIndex(p); list.setSelectedIndex(index); } // show context menu getPopupMenu().show(e.getComponent(), p.x, p.y);
if (list.getSelectedIndices().length <= 1) { // select new item int index = list.locationToIndex(p); list.setSelectedIndex(index); } // show context menu getPopupMenu().show(e.getComponent(), p.x, p.y);
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 handlePopupEvent(MouseEvent) Method name: void handlePopupEvent(MouseEvent)
Number of AST nodes: 4 Number of AST nodes: 4
1
if ( list.getSelectedIndices().length <= 1 ) {
1
if (list.getSelectedIndices().length <= 1) {
2
					// select new item
2
					// select new item
3
					int index = list.locationToIndex(p);
3
					int index = list.locationToIndex(p);
4
					list.setSelectedIndex(index);
4
					list.setSelectedIndex(index);
5
				}
5
				}
6
				// show context menu
6
				// show context menu
7
				getPopupMenu().show(e.getComponent(), p.x, p.y);
7
				getPopupMenu().show(e.getComponent(), p.x, p.y);
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.5
Clones locationClones are in different classes having the same super class
Number of node comparisons11
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    if (list.getSelectedIndices().length <= 1)
    3
    if (list.getSelectedIndices().length <= 1)
    3
    if (list.getSelectedIndices().length <= 1)
    Differences
    Expression1Expression2Difference
    org.columba.calendar.ui.box.CalendarListorg.columba.contact.gui.box.ContactListSUBCLASS_TYPE_MISMATCH
    3
    if (list.getSelectedIndices().length <= 1)
    4
    int index = list.locationToIndex(p);
    4
    int index = list.locationToIndex(p);
    4
    int index = list.locationToIndex(p);
    Differences
    Expression1Expression2Difference
    org.columba.calendar.ui.box.CalendarListorg.columba.contact.gui.box.ContactListSUBCLASS_TYPE_MISMATCH
    4
    int index = list.locationToIndex(p);
    5
    list.setSelectedIndex(index);
    5
    list.setSelectedIndex(index);
    5
    list.setSelectedIndex(index);
    Differences
    Expression1Expression2Difference
    org.columba.calendar.ui.box.CalendarListorg.columba.contact.gui.box.ContactListSUBCLASS_TYPE_MISMATCH
    5
    list.setSelectedIndex(index);
    6
    getPopupMenu().show(e.getComponent(), p.x, p.y);
    6
    getPopupMenu().show(e.getComponent(), p.x, p.y);
    Precondition Violations (0)
    Row Violation