IHeaderItem item = null;
try {
item = (IHeaderItem)super.clone();
} catch (CloneNotSupportedException e) {
// This should never happen since superclass is Object
e.printStackTrace();
}
return item;
URI uri = null;
try {
uri = new URI("columba://org.columba.contact/" + folderId + "/"
+ contactId);
} catch (URISyntaxException e) {
e.printStackTrace();
}
return uri;
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/contact-facade/src/main/java/org/columba/addressbook/facade/HeaderItem.java
|
|
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/action/TagContactMenu.java
|
Method name: Object clone()
|
|
Method name: URI createURI(String, Object)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | IHeaderItem item = null;↵ | | 1 | URI uri = null;↵
|
2 | try {↵ | | 2 | try {↵
|
3 | item = (IHeaderItem)super.clone();↵ | | 3 | ↵
|
4 | } catch (CloneNotSupportedException e) {↵ | | |
|
5 | // This should never happen since superclass is Object↵ | | 4 | uri = new URI("columba://org.columba.contact/" + folderId + "/"↵
|
| | | 5 | + contactId);↵
|
| | | 6 | } catch (URISyntaxException e) {↵
|
6 | e.printStackTrace();↵ | | 7 | e.printStackTrace();↵
|
7 | }↵ | | 8 | }↵
|
8 | return item; | | 9 | return uri;
|
See real code fragment |
|
See real code fragment |
Summary
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 8 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 0.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
| | | 1 | URI uri = null; |
1 | IHeaderItem item = null; | | | |
2 | try | | 2 | try |
| | | 3 | uri = new URI("columba://org.columba.contact/" + folderId + "/" + contactId); |
3 | item = (IHeaderItem)super.clone(); | | | |
| | | 4 | return uri; |
4 | return item; | | | |
Precondition Violations (3)
Row |
Violation |
1 | Unmatched statement item=(IHeaderItem)super.clone(); 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 |
2 | Unmatched return uri; |
3 | Unmatched return item; |