if (e.isPopupTrigger()) { // check if a single entry is selected 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 (e.isPopupTrigger()) { // check if a single entry is selected 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: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
if (e.isPopupTrigger()) {
1
if (e.isPopupTrigger()) {
2
				// check if a single entry is selected
2
				// check if a single entry is selected
3
				if ( list.getSelectedIndices().length <= 1 ) {
3
				if (list.getSelectedIndices().length <= 1) {
4
					// select new item
4
					// select new item
5
					int index = list.locationToIndex(p);
5
					int index = list.locationToIndex(p);
6
					list.setSelectedIndex(index);
6
					list.setSelectedIndex(index);
7
				}
7
				}
8
				// show context menu
8
				// show context menu
9
				getPopupMenu().show(e.getComponent(), p.x, p.y);
9
				getPopupMenu().show(e.getComponent(), p.x, p.y);
10
			}
10
			}
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0