if (isPopAccount()) { if (((Integer) portSpinner.getValue()).intValue() != POP3Protocol.DEFAULT_PORT) { portSpinner.setValue(new Integer( POP3Protocol.DEFAULT_PORT)); showPortChangeMessageBox(); } } else { if (((Integer) portSpinner.getValue()).intValue() != IMAPProtocol.DEFAULT_PORT) { portSpinner.setValue(new Integer( IMAPProtocol.DEFAULT_PORT)); showPortChangeMessageBox(); } }
if (isPopAccount()) { if (((Integer) portSpinner.getValue()).intValue() != POP3Protocol.DEFAULT_PORT) { portSpinner.setValue(new Integer( POP3Protocol.DEFAULT_PORT)); showPortChangeMessageBox(); } } else { if (((Integer) portSpinner.getValue()).intValue() != IMAPProtocol.DEFAULT_PORT) { portSpinner.setValue(new Integer( IMAPProtocol.DEFAULT_PORT)); showPortChangeMessageBox(); } }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/account/IncomingServerPanel.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/account/IncomingServerPanel.java
Method name: void actionPerformed(ActionEvent) Method name: void actionPerformed(ActionEvent)
Number of AST nodes: 7 Number of AST nodes: 7
1
if (isPopAccount()) {
1
if (isPopAccount()) {
2
					if (((Integer) portSpinner.getValue()).intValue() != POP3Protocol.DEFAULT_PORT) {
2
						if (((Integer) portSpinner.getValue()).intValue() != POP3Protocol.DEFAULT_PORT) {
3
						portSpinner.setValue(new Integer(
3
							portSpinner.setValue(new Integer(
4
								POP3Protocol.DEFAULT_PORT));
4
									POP3Protocol.DEFAULT_PORT));
5
						showPortChangeMessageBox();
5
							showPortChangeMessageBox();
6
					}
6
						}
7
				} else {
7
					} else {
8
					if (((Integer) portSpinner.getValue()).intValue() != IMAPProtocol.DEFAULT_PORT) {
8
						if (((Integer) portSpinner.getValue()).intValue() != IMAPProtocol.DEFAULT_PORT) {
9
						portSpinner.setValue(new Integer(
9
							portSpinner.setValue(new Integer(
10
								IMAPProtocol.DEFAULT_PORT));
10
									IMAPProtocol.DEFAULT_PORT));
11
						showPortChangeMessageBox();
11
							showPortChangeMessageBox();
12
					}
12
						}
13
				}
13
					}
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.9
Clones locationClones are in the same method
Number of node comparisons29
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    34
    if (isPopAccount())
    34
    if (isPopAccount())
    20
    if (isPopAccount())
    Differences
    Expression1Expression2Difference
    isPopAccount()isPopAccount()IF_ELSE_SYMMETRICAL_MATCH
    20
    if (isPopAccount())
    35
    if (((Integer)portSpinner.getValue()).intValue() != POP3Protocol.DEFAULT_PORT)
    35
    if (((Integer)portSpinner.getValue()).intValue() != POP3Protocol.DEFAULT_PORT)
    24
    if (((Integer)portSpinner.getValue()).intValue() != IMAPProtocol.DEFAULT_PORT)
    Differences
    Expression1Expression2Difference
    org.columba.ristretto.pop3.POP3Protocolorg.columba.ristretto.imap.IMAPProtocolVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.ristretto.pop3.POP3Protocol of variable POP3Protocol does not match with type org.columba.ristretto.imap.IMAPProtocol of variable IMAPProtocol
    • Make classes org.columba.ristretto.pop3.POP3Protocol and org.columba.ristretto.imap.IMAPProtocol extend a common superclass
    24
    if (((Integer)portSpinner.getValue()).intValue() != IMAPProtocol.DEFAULT_PORT)
    36
    portSpinner.setValue(new Integer(POP3Protocol.DEFAULT_PORT));
    36
    portSpinner.setValue(new Integer(POP3Protocol.DEFAULT_PORT));
    25
    portSpinner.setValue(new Integer(IMAPProtocol.DEFAULT_PORT));
    Differences
    Expression1Expression2Difference
    org.columba.ristretto.pop3.POP3Protocolorg.columba.ristretto.imap.IMAPProtocolVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.ristretto.pop3.POP3Protocol of variable POP3Protocol does not match with type org.columba.ristretto.imap.IMAPProtocol of variable IMAPProtocol
    • Make classes org.columba.ristretto.pop3.POP3Protocol and org.columba.ristretto.imap.IMAPProtocol extend a common superclass
    25
    portSpinner.setValue(new Integer(IMAPProtocol.DEFAULT_PORT));
    37
    showPortChangeMessageBox();
    26
    showPortChangeMessageBox();
    else
    else
    38
    if (((Integer)portSpinner.getValue()).intValue() != IMAPProtocol.DEFAULT_PORT)
    38
    if (((Integer)portSpinner.getValue()).intValue() != IMAPProtocol.DEFAULT_PORT)
    21
    if (((Integer)portSpinner.getValue()).intValue() != POP3Protocol.DEFAULT_PORT)
    Differences
    Expression1Expression2Difference
    org.columba.ristretto.imap.IMAPProtocolorg.columba.ristretto.pop3.POP3ProtocolVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.ristretto.imap.IMAPProtocol of variable IMAPProtocol does not match with type org.columba.ristretto.pop3.POP3Protocol of variable POP3Protocol
    • Make classes org.columba.ristretto.imap.IMAPProtocol and org.columba.ristretto.pop3.POP3Protocol extend a common superclass
    21
    if (((Integer)portSpinner.getValue()).intValue() != POP3Protocol.DEFAULT_PORT)
    39
    portSpinner.setValue(new Integer(IMAPProtocol.DEFAULT_PORT));
    39
    portSpinner.setValue(new Integer(IMAPProtocol.DEFAULT_PORT));
    22
    portSpinner.setValue(new Integer(POP3Protocol.DEFAULT_PORT));
    Differences
    Expression1Expression2Difference
    org.columba.ristretto.imap.IMAPProtocolorg.columba.ristretto.pop3.POP3ProtocolVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.ristretto.imap.IMAPProtocol of variable IMAPProtocol does not match with type org.columba.ristretto.pop3.POP3Protocol of variable POP3Protocol
    • Make classes org.columba.ristretto.imap.IMAPProtocol and org.columba.ristretto.pop3.POP3Protocol extend a common superclass
    22
    portSpinner.setValue(new Integer(POP3Protocol.DEFAULT_PORT));
    40
    showPortChangeMessageBox();
    23
    showPortChangeMessageBox();
    Precondition Violations (4)
    Row Violation
    1Type org.columba.ristretto.pop3.POP3Protocol of variable POP3Protocol does not match with type org.columba.ristretto.imap.IMAPProtocol of variable IMAPProtocol
    2Type org.columba.ristretto.pop3.POP3Protocol of variable POP3Protocol does not match with type org.columba.ristretto.imap.IMAPProtocol of variable IMAPProtocol
    3Type org.columba.ristretto.imap.IMAPProtocol of variable IMAPProtocol does not match with type org.columba.ristretto.pop3.POP3Protocol of variable POP3Protocol
    4Type org.columba.ristretto.imap.IMAPProtocol of variable IMAPProtocol does not match with type org.columba.ristretto.pop3.POP3Protocol of variable POP3Protocol