if( e.getKeyCode() == KeyEvent.VK_DELETE) { removeSelected(); }
if (protocol.getState() < POP3Protocol.AUTHORIZATION) { openConnection(); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/composer/AttachmentView.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/pop3/POP3Store.java
Method name: void keyPressed(KeyEvent) Method name: void ensureAuthorization()
Number of AST nodes: 2 Number of AST nodes: 2
1
if( e.getKeyCode() == KeyEvent.VK_DELETE) {
1
if
2
					removeSelected
2
 (protocol.getState() < POP3Protocol.AUTHORIZATION) {
3
();
3
			openConnection();
4
				}
4
		}
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)30.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (e.getKeyCode() == KeyEvent.VK_DELETE)
    1
    if (e.getKeyCode() == KeyEvent.VK_DELETE)
    1
    if (protocol.getState() < POP3Protocol.AUTHORIZATION)
    Differences
    Expression1Expression2Difference
    getKeyCodegetStateMETHOD_INVOCATION_NAME_MISMATCH
    eprotocolVARIABLE_NAME_MISMATCH
    java.awt.event.KeyEventorg.columba.ristretto.pop3.POP3ProtocolVARIABLE_TYPE_MISMATCH
    java.awt.event.KeyEventorg.columba.ristretto.pop3.POP3ProtocolVARIABLE_TYPE_MISMATCH
    VK_DELETEAUTHORIZATIONVARIABLE_NAME_MISMATCH
    ==<OPERATOR_MISMATCH
    Preondition Violations
    Type java.awt.event.KeyEvent of variable e does not match with type org.columba.ristretto.pop3.POP3Protocol of variable protocol
    • Make classes java.awt.event.KeyEvent and org.columba.ristretto.pop3.POP3Protocol extend a common superclass
    Type java.awt.event.KeyEvent does not match with type org.columba.ristretto.pop3.POP3Protocol
    • Make classes java.awt.event.KeyEvent and org.columba.ristretto.pop3.POP3Protocol extend a common superclass
    1
    if (protocol.getState() < POP3Protocol.AUTHORIZATION)
    2
    removeSelected();
    2
    removeSelected();
    2
    openConnection();
    Differences
    Expression1Expression2Difference
    removeSelectedopenConnectionMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression removeSelected() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression openConnection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method openConnection
    Expression removeSelected() is a void method call, and thus it cannot be parameterized
    Expression openConnection() is a void method call, and thus it cannot be parameterized
    2
    openConnection();
    Precondition Violations (7)
    Row Violation
    1Type java.awt.event.KeyEvent of variable e does not match with type org.columba.ristretto.pop3.POP3Protocol of variable protocol
    2Type java.awt.event.KeyEvent does not match with type org.columba.ristretto.pop3.POP3Protocol
    3Expression removeSelected() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression openConnection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression removeSelected() is a void method call, and thus it cannot be parameterized
    6Expression openConnection() is a void method call, and thus it cannot be parameterized
    7The refactoring of the clones is infeasible, because classes and org.columba.mail.pop3.POP3Store do not have a common superclass