if (e.getValueIsAdjusting()) { return; } DefaultListSelectionModel theList = (DefaultListSelectionModel) e .getSource(); if (!theList.isSelectionEmpty()) { index = theList.getAnchorSelectionIndex(); selection = (CheckableItemImpl) ((CheckableItemListTableModel) list .getModel()).getElement(index); updateButtonState(); }
if (e.getValueIsAdjusting()) { return; } DefaultListSelectionModel theList = (DefaultListSelectionModel) e .getSource(); if (!theList.isSelectionEmpty()) { CheckableItem item = (CheckableItem) checkableList.getSelected(); updateButtonState(item.isSelected()); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/columns/ColumnConfigDialog.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/folder/FolderOptionsDialog.java
Method name: void valueChanged(ListSelectionEvent) Method name: void valueChanged(ListSelectionEvent)
Number of AST nodes: 7 Number of AST nodes: 6
1
if (e.getValueIsAdjusting()) {
1
if (e.getValueIsAdjusting()) {
2
			return;
2
			return;
3
		}
3
		}
4
		DefaultListSelectionModel theList = (DefaultListSelectionModel) e
4
		DefaultListSelectionModel theList = (DefaultListSelectionModel) e
5
				.getSource();
5
				.getSource();
6
		if (!theList.isSelectionEmpty()) {
6
		if (!theList.isSelectionEmpty()) {
7
			index = theList.getAnchorSelectionIndex();
7
			
8
			selection
9
 = (CheckableItemImpl) ((CheckableItemListTableModel) list
8
			CheckableItem item = (CheckableItem
10
					.getModel()).getElement(index);
9
) checkableList.getSelected();
11
			updateButtonState();
10
			updateButtonState(item.isSelected());
12
		}
11
		}
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.3
Clones locationClones are in different classes having the same super class
Number of node comparisons24
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)3.1
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (e.getValueIsAdjusting())
    1
    if (e.getValueIsAdjusting())
    2
    return;
    2
    return;
    3
    DefaultListSelectionModel theList = (DefaultListSelectionModel)e.getSource();
    3
    DefaultListSelectionModel theList = (DefaultListSelectionModel)e.getSource();
    4
    if (!theList.isSelectionEmpty())
    4
    if (!theList.isSelectionEmpty())
                                                                                                                                      
    5
    CheckableItem item = (CheckableItem)checkableList.getSelected();
    5
    index = theList.getAnchorSelectionIndex();
    5
    index = theList.getAnchorSelectionIndex();
    Preondition Violations
    Unmatched statement index=theList.getAnchorSelectionIndex(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                          
    6
    selection = (CheckableItemImpl)((CheckableItemListTableModel)list.getModel()).getElement(index);
    6
    selection = (CheckableItemImpl)((CheckableItemListTableModel)list.getModel()).getElement(index);
    Preondition Violations
    Unmatched statement selection=(CheckableItemImpl)((CheckableItemListTableModel)list.getModel()).getElement(index); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                                                                      
    7
    updateButtonState();
    7
    updateButtonState();
    6
    updateButtonState(item.isSelected());
    Differences
    Expression1Expression2Difference
    updateButtonState()updateButtonState(item.isSelected())ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression updateButtonState() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method updateButtonState
    Expression updateButtonState(item.isSelected()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method updateButtonState
    Expression updateButtonState() is a void method call, and thus it cannot be parameterized
    Expression updateButtonState(item.isSelected()) is a void method call, and thus it cannot be parameterized
    6
    updateButtonState(item.isSelected());
    Precondition Violations (6)
    Row Violation
    1Unmatched statement index=theList.getAnchorSelectionIndex(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement selection=(CheckableItemImpl)((CheckableItemListTableModel)list.getModel()).getElement(index); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Expression updateButtonState() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression updateButtonState(item.isSelected()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression updateButtonState() is a void method call, and thus it cannot be parameterized
    6Expression updateButtonState(item.isSelected()) is a void method call, and thus it cannot be parameterized