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: void login()
|
Method name: void login()
|
|||
Number of AST nodes: 3 | Number of AST nodes: 3 | |||
1 | try {↵ | 1 | try {↵ | |
2 | // AUTH↵ | 2 | // AUTH↵ | |
3 | protocol.authenticate(AuthenticationManager↵ | 3 | protocol.auth(AuthenticationManager↵ | |
4 | .getSaslName(loginMethod), item.get("user"),↵ | 4 | .getSaslName(loginMethod), popItem.get("user"),↵ | |
5 | password);↵ | 5 | password);↵ | |
6 | // If no exception happened we have successfully logged↵ | 6 | ↵ | |
7 | // in↵ | |||
8 | authenticated = true;↵ | 7 | login = true;↵ | |
9 | } catch (AuthenticationException e) {↵ | 8 | } catch (AuthenticationException e) {↵ | |
10 | // If the cause is a IMAPExcpetion then only password↵ | 9 | // If the cause is a IMAPExcpetion then only password↵ | |
11 | // wrong↵ | 10 | // wrong↵ | |
12 | // else bogus authentication mechanism↵ | 11 | // else bogus authentication mechanism↵ | |
13 | if (e.getCause() instanceof IMAPException)↵ | 12 | if (e.getCause() instanceof POP3Exception)↵ | |
14 | throw (IMAPException) e.getCause();↵ | 13 | throw (POP3Exception) e.getCause();↵ | |
15 | // Some error in the client/server communication↵ | 14 | // Some error in the client/server communication↵ | |
16 | // --> fall back to default login process↵ | 15 | // --> fall back to default login process↵ | |
17 | int result = JOptionPane↵ | 16 | int result = JOptionPane↵ | |
18 | .showConfirmDialog(↵ | 17 | .showConfirmDialog(↵ | |
19 | FrameManager.getInstance()↵ | 18 | FrameManager.getInstance()↵ | |
20 | .getActiveFrame(),↵ | 19 | .getActiveFrame(),↵ | |
21 | new MultiLineLabel(↵ | 20 | new MultiLineLabel(↵ | |
22 | e.getMessage()↵ | 21 | e.getMessage()↵ | |
23 | + "\n"↵ | 22 | + "\n"↵ | |
24 | + MailResourceLoader↵ | 23 | + MailResourceLoader↵ | |
25 | .getString(↵ | 24 | .getString(↵ | |
26 | "dialog",↵ | 25 | "dialog",↵ | |
27 | "error",↵ | 26 | "error",↵ | |
28 | "authentication_fallback_to_default")),↵ | 27 | "authentication_fallback_to_default")),↵ | |
29 | MailResourceLoader.getString("dialog",↵ | 28 | MailResourceLoader.getString("dialog",↵ | |
30 | "error",↵ | 29 | "error",↵ | |
31 | "authentication_process_error"),↵ | 30 | "authentication_process_error"),↵ | |
32 | JOptionPane.OK_CANCEL_OPTION);↵ | 31 | JOptionPane.OK_CANCEL_OPTION);↵ | |
33 | if (result == JOptionPane.OK_OPTION) {↵ | 32 | if (result == JOptionPane.OK_OPTION) {↵ | |
34 | loginMethod = AuthenticationManager.LOGIN;↵ | 33 | loginMethod = AuthenticationManager.USER;↵ | |
35 | item.setString("login_method", Integer↵ | 34 | popItem.setString("login_method", Integer↵ | |
36 | .toString(loginMethod));↵ | 35 | .toString(loginMethod));↵ | |
37 | } else {↵ | 36 | } else {↵ | |
38 | throw new CommandCancelledException();↵ | 37 | throw new CommandCancelledException();↵ | |
39 | }↵ | 38 | }↵ | |
40 | } | 39 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 2.6 |
Clones location | Clones are in different classes |
Number of node comparisons | 11 |
Number of mapped statements | 3 |
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) | 14.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
24 | try |
| 23 | try | ||||||||||||||||||||||||||
25 | protocol.authenticate(AuthenticationManager.getSaslName(loginMethod), item.get("user"), password); |
| 24 | protocol.auth(AuthenticationManager.getSaslName(loginMethod), popItem.get("user"), password); | ||||||||||||||||||||||||||
26 | authenticated = true; |
| 25 | login = true; |
Row | Violation |
---|---|
1 | Expression e.getCause() instanceof IMAPException cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression e.getCause() instanceof POP3Exception cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression (IMAPException)e.getCause() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression (POP3Exception)e.getCause() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression protocol.authenticate(AuthenticationManager.getSaslName(loginMethod),item.get("user"),password) is a method call throwing exception(s) that should be caught by a try block that will be extracted |
6 | Expression protocol.auth(AuthenticationManager.getSaslName(loginMethod),popItem.get("user"),password) is a method call throwing exception(s) that should be caught by a try block that will be extracted |
7 | Expression protocol.authenticate(AuthenticationManager.getSaslName(loginMethod),item.get("user"),password) is a void method call, and thus it cannot be parameterized |
8 | Expression protocol.auth(AuthenticationManager.getSaslName(loginMethod),popItem.get("user"),password) is a void method call, and thus it cannot be parameterized |
9 | Expression protocol cannot be unified with expression protocol , because common superclass org.columba.ristretto.auth.AuthenticationServer does not declare member(s) public void authenticate(java.lang.String, java.lang.String, char[]) throws java.io.IOException, org.columba.ristretto.imap.IMAPException, org.columba.ristretto.auth.AuthenticationException, public void auth(java.lang.String, java.lang.String, char[]) throws java.io.IOException, org.columba.ristretto.pop3.POP3Exception, org.columba.ristretto.auth.AuthenticationException |