File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/folder/temp/TempFolder.java | File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/util/AddressListRenderer.java | |||
Method name: void innerCopy(IMailbox, Object[])
|
Method name: String[] convertToStringArray(Address[])
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | for (int i = 0; i < uids.length; i++) {↵ | |||
2 | InputStream messageSourceStream = getMessageSourceStream(uid↵ | 1 | if ((addresses != null) && (addresses.length > 0)) {↵ | |
3 | s[i]);↵ | 2 | //String str = createAddressString(addresses[0]);↵ | |
4 | destFolder.addMessage(messageSourceStream);↵ | |||
5 | messageSourceStream.close();↵ | |||
6 | ↵ | 3 | //vector.add(str);↵ | |
4 | for (int i = 0; i < addresses.length; i++) {↵ | |||
5 | // result.append(", ");↵ | |||
6 | String str = createAddressString(addresses[i]);↵ | |||
7 | vector.add(str);↵ | |||
8 | }↵ | |||
7 | } | 9 | } | |
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.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 12 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 1.5 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | for (int i = 0; i < uids.length; i++) |
| 3 | for (int i = 0; i < addresses.length; i++) | ||||||||||||||
2 | InputStream messageSourceStream = getMessageSourceStream(uids[i]); |
| | |||||||||||||||
3 | destFolder.addMessage(messageSourceStream); |
| | |||||||||||||||
|
| 4 | String str = createAddressString(addresses[i]); | |||||||||||||||
4 | messageSourceStream.close(); |
| | |||||||||||||||
|
| 5 | vector.add(str); |
Row | Violation |
---|---|
1 | Type int of variable uids.length does not match with type int of variable addresses.length |
2 | Unmatched statement InputStream messageSourceStream=getMessageSourceStream(uids[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement InputStream messageSourceStream=getMessageSourceStream(uids[i]); 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 destFolder.addMessage(messageSourceStream); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement destFolder.addMessage(messageSourceStream); 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 |
6 | Unmatched statement String str=createAddressString(addresses[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Unmatched statement messageSourceStream.close(); 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 |
8 | Unmatched statement vector.add(str); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
9 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero |