File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/accountwizard/AccountCreator.java | File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/filter/CriteriaList.java | |||
Method name: void wizardFinished(WizardModelEvent)
|
Method name: void update()
|
|||
Number of AST nodes: 6 | Number of AST nodes: 7 | |||
1 | ImapItem imap = account.getImapItem();↵ | |||
2 | imap↵ | |||
3 | .setString("host", (String) data↵ | |||
4 | .getData("IncomingServer.host"));↵ | |||
5 | imap.setString("user", (String) data↵ | |||
6 | .getData("IncomingServer.login"));↵ | |||
7 | // TODO (@author fdietz): All this code for creating a new↵ | |||
8 | // IMAPRootFolder should↵ | |||
9 | // be moved to a FolderFactory↵ | |||
10 | // -> this way "path" would be handled in the factory, too↵ | |||
11 | // parent directory for mail folders↵ | |||
12 | // for example: ".columba/mail/"↵ | |||
13 | // String path =↵ | |||
14 | // MailConfig.getInstance().getConfigDirectory().getPath(↵ | 1 | if (column == null) {↵ | |
2 | try {↵ | |||
3 | IExtension extension = pluginHandler.getExtension("Subject");↵ | |||
15 | );↵ | 4 | String uiId = extension.getMetadata().getAttribute("ui");↵ | |
16 | try {↵ | 5 | ↵ | |
17 | // IMAPRootFolder parentFolder = FolderFactory.getInstance()↵ | |||
18 | // .createIMAPRootFolder(account);↵ | |||
19 | // IMailFolder inbox = FolderFactory.getInstance()↵ | |||
20 | // .createIMAPFolder(parentFolder, "INBOX");↵ | |||
21 | IMailFolder inbox = FolderFactory.getInstance().createIMAPRootFolder(account);↵ | |||
22 | folder = inbox;↵ | |||
23 | } catch (FolderCreation↵ | 6 | IExtension uiExtension = pluginUIHandler.getExtension(uiId);↵ | |
7 | column = (DefaultCriteriaRow) uiExtension↵ | |||
8 | .instanciateExtension(args);↵ | |||
24 | Exception e1) {↵ | 9 | } catch (Exception ex) {↵ | |
25 | e1.printStackTrace();↵ | 10 | ex.printStackTrace();↵ | |
26 | ↵ | 11 | }↵ | |
12 | criteria.setTypeString("Subject");↵ | |||
27 | } | 13 | } | |
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) | 0.4 |
Clones location | Clones are in different classes |
Number of node comparisons | 18 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 5.9 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
14 | ImapItem imap = account.getImapItem(); |
| | |||||||||||||||||||||||
15 | imap.setString("host", (String)data.getData("IncomingServer.host")); | | ||||||||||||||||||||||||
16 | imap.setString("user", (String)data.getData("IncomingServer.login")); | | ||||||||||||||||||||||||
17 | try |
| 25 | try | ||||||||||||||||||||||
18 | IMailFolder inbox = FolderFactory.getInstance().createIMAPRootFolder(account); |
| | |||||||||||||||||||||||
|
| 26 | IExtension extension = pluginHandler.getExtension("Subject"); | |||||||||||||||||||||||
| 27 | String uiId = extension.getMetadata().getAttribute("ui"); | ||||||||||||||||||||||||
|
| 28 | IExtension uiExtension = pluginUIHandler.getExtension(uiId); | |||||||||||||||||||||||
19 | folder = inbox; |
| 29 | column = (DefaultCriteriaRow)uiExtension.instanciateExtension(args); | ||||||||||||||||||||||
| 30 | criteria.setTypeString("Subject"); |
Row | Violation |
---|---|
1 | Unmatched statement ImapItem imap=account.getImapItem(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement IMailFolder inbox=FolderFactory.getInstance().createIMAPRootFolder(account); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched statement IMailFolder inbox=FolderFactory.getInstance().createIMAPRootFolder(account); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
4 | Unmatched statement IExtension extension=pluginHandler.getExtension("Subject"); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
5 | Unmatched statement IExtension uiExtension=pluginUIHandler.getExtension(uiId); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement IExtension uiExtension=pluginUIHandler.getExtension(uiId); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
7 | Expression inbox cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression (DefaultCriteriaRow)uiExtension.instanciateExtension(args) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Clone fragment #1 returns variable folder with type org.columba.mail.folder.IMailFolder , while Clone fragment #2 returns variable column with type org.columba.mail.gui.config.filter.plugins.DefaultCriteriaRow |