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();
}
if (usingSSL) {
// NOTE if SSL is possible we just need the plain login
// since SSL does the encryption for us.
method = ((Integer) supported.get(0)).intValue();
} else {
Collections.sort(supported,
new AuthenticationSecurityComparator());
method = ((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/smtp/SMTPServer.java
|
Method name: int getLoginMethod()
|
|
Method name: int getLoginMethod()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | if (usingSSL) {↵ | | 1 | if (usingSSL) {↵
|
2 | // NOTE if SSL is possible we just need the plain login↵ | | 2 | // NOTE if SSL is possible we just need the plain login↵
|
3 | // since SSL does the encryption for us.↵ | | 3 | // since SSL does the encryption for us.↵
|
4 | result = ((Integer) supported.get(0)).intValue();↵ | | 4 | method = ((Integer) supported.get(0)).intValue();↵
|
5 | } else {↵ | | 5 | } else {↵
|
6 | Collections.sort(supported,↵ | | 6 | Collections.sort(supported,↵
|
7 | new AuthenticationSecurityComparator());↵ | | 7 | new AuthenticationSecurityComparator());↵
|
8 | result = ((Integer) supported.get(supported.size() - 1))↵ | | 8 | method = ((Integer) supported.get(supported.size() - 1))↵
|
9 | .intValue();↵ | | 9 | .intValue();↵
|
10 | } | | 10 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 17 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 3.3 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
7 | if (usingSSL) | | 11 | if (usingSSL) |
8 | result = ((Integer)supported.get(0)).intValue(); | | 12 | method = ((Integer)supported.get(0)).intValue(); |
| | | | |
9 | Collections.sort(supported, new AuthenticationSecurityComparator()); | | 13 | Collections.sort(supported, new AuthenticationSecurityComparator()); |
10 | result = ((Integer)supported.get(supported.size() - 1)).intValue(); | | 14 | method = ((Integer)supported.get(supported.size() - 1)).intValue(); |
Precondition Violations (0)
Row |
Violation |