if (e.getStateChange() == ItemEvent.SELECTED) { updateComponents(false); }
if( e.getKeyCode() == KeyEvent.VK_DELETE) { removeSelected(); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/composer/AccountController.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/composer/AttachmentView.java
Method name: void itemStateChanged(ItemEvent) Method name: void keyPressed(KeyEvent)
Number of AST nodes: 2 Number of AST nodes: 2
1
if (e.getStateChange() == ItemEvent.SELECTED) {
1
if( e.getKeyCode() == KeyEvent.VK_DELETE) {
2
			updateComponents(false);
2
					removeSelected();
3
		}
3
				}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.4
Clones locationClones are in different classes
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)26.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (e.getStateChange() == ItemEvent.SELECTED)
    1
    if (e.getStateChange() == ItemEvent.SELECTED)
    1
    if (e.getKeyCode() == KeyEvent.VK_DELETE)
    Differences
    Expression1Expression2Difference
    getStateChangegetKeyCodeMETHOD_INVOCATION_NAME_MISMATCH
    java.awt.event.ItemEventjava.awt.event.KeyEventSUBCLASS_TYPE_MISMATCH
    java.awt.event.ItemEventjava.awt.event.KeyEventSUBCLASS_TYPE_MISMATCH
    SELECTEDVK_DELETEVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression e cannot be unified with expression e , because common superclass java.awt.AWTEvent does not declare member(s) public int getStateChange() , public int getKeyCode()
    Expression ItemEvent cannot be unified with expression KeyEvent , because common superclass java.awt.AWTEvent does not declare member(s) public int getStateChange() , public int getKeyCode()
    1
    if (e.getKeyCode() == KeyEvent.VK_DELETE)
    2
    updateComponents(false);
    2
    updateComponents(false);
    2
    removeSelected();
    Differences
    Expression1Expression2Difference
    updateComponentsremoveSelectedMETHOD_INVOCATION_NAME_MISMATCH
    updateComponents(false)removeSelected()ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression updateComponents(false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression removeSelected() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression updateComponents(false) is a void method call, and thus it cannot be parameterized
    Expression removeSelected() is a void method call, and thus it cannot be parameterized
    Expression updateComponents(false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression removeSelected() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression updateComponents(false) is a void method call, and thus it cannot be parameterized
    Expression removeSelected() is a void method call, and thus it cannot be parameterized
    2
    removeSelected();
    Precondition Violations (11)
    Row Violation
    1Expression e cannot be unified with expression e , because common superclass java.awt.AWTEvent does not declare member(s) public int getStateChange() , public int getKeyCode()
    2Expression ItemEvent cannot be unified with expression KeyEvent , because common superclass java.awt.AWTEvent does not declare member(s) public int getStateChange() , public int getKeyCode()
    3Expression updateComponents(false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression removeSelected() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression updateComponents(false) is a void method call, and thus it cannot be parameterized
    6Expression removeSelected() is a void method call, and thus it cannot be parameterized
    7Expression updateComponents(false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression removeSelected() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression updateComponents(false) is a void method call, and thus it cannot be parameterized
    10Expression removeSelected() is a void method call, and thus it cannot be parameterized
    11The refactoring of the clones is infeasible, because classes org.columba.mail.gui.composer.AccountController and do not have a common superclass