List supported = checkSupportedAuthenticationMethods(); if (usingSSL) { // NOTE if SSL is possible we just need the plain login // since SSL does the encryption for us. result = ((Integer) supported.get(0)).intValue(); } else { Collections.sort(supported, new AuthenticationSecurityComparator()); result = ((Integer) supported.get(supported.size() - 1)) .intValue(); }
List supported = checkSupportedAuthenticationMethods(); if (usingSSL) { // NOTE if SSL is possible we just need the plain login // since SSL does the encryption for us. result = ((Integer) supported.get(0)).intValue(); } else { Collections.sort(supported, new AuthenticationSecurityComparator()); result = ((Integer) supported.get(supported.size() - 1)) .intValue(); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/imap/IMAPServer.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/pop3/POP3Store.java
Method name: int getLoginMethod() Method name: int getLoginMethod()
Number of AST nodes: 5 Number of AST nodes: 5
1
List supported = checkSupportedAuthenticationMethods();
1
List supported = checkSupportedAuthenticationMethods();
2
			if (usingSSL) {
2
			if (usingSSL) {
3
				// NOTE if SSL is possible we just need the plain login
3
				// NOTE if SSL is possible we just need the plain login
4
				// since SSL does the encryption for us.
4
				// since SSL does the encryption for us.
5
				result = ((Integer) supported.get(0)).intValue();
5
				result = ((Integer) supported.get(0)).intValue();
6
			} else {
6
			} else {
7
				Collections.sort(supported,
7
				Collections.sort(supported,
8
						new AuthenticationSecurityComparator());
8
						new AuthenticationSecurityComparator());
9
				result = ((Integer) supported.get(supported.size() - 1))
9
				result = ((Integer) supported.get(supported.size() - 1))
10
						.intValue();
10
						.intValue();
11
			}
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.1
Clones locationClones are in different classes
Number of node comparisons18
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    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.9
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    6
    List supported = checkSupportedAuthenticationMethods();
    6
    List supported = checkSupportedAuthenticationMethods();
    7
    if (usingSSL)
    7
    if (usingSSL)
    8
    result = ((Integer)supported.get(0)).intValue();
    8
    result = ((Integer)supported.get(0)).intValue();
    else
    else
    9
    Collections.sort(supported, new AuthenticationSecurityComparator());
    9
    Collections.sort(supported, new AuthenticationSecurityComparator());
    10
    result = ((Integer)supported.get(supported.size() - 1)).intValue();
    10
    result = ((Integer)supported.get(supported.size() - 1)).intValue();
    Precondition Violations (0)
    Row Violation