if (insertLink) {
String email = s.substring(s1, e1);
String link = "<a href=\"mailto:" + email + "\">" + email
+ "</a>";
buf.append(s.substring(pos, s1));
buf.append(link);
pos = e1;
}
if (insertLink) {
String url = s.substring(s1, e1);
String link = "<a href=\"" + url + "\">" + url + "</a>";
buf.append(s.substring(pos, s1));
buf.append(link);
pos = e1;
}
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/parser/text/HtmlParser.java
|
|
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/parser/text/HtmlParser.java
|
Method name: String substituteEmailAddress(String, boolean)
|
|
Method name: String substituteURL(String, boolean)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | if (insertLink) {↵ | | 1 | if (insertLink) {↵
|
2 | String email = s.substring(s1, e1);↵ | | 2 | String url = s.substring(s1, e1);↵
|
3 | String link = "<a href=\"mailto:" + email + "\">" + email↵ | | 3 | String link = "<a href=\"↵
|
4 | + "</a>";↵ | | 4 | " + url + "\">" + url + "</a>";↵
|
5 | buf.append(s.substring(pos, s1));↵ | | 5 | buf.append(s.substring(pos, s1));↵
|
6 | buf.append(link);↵ | | 6 | buf.append(link);↵
|
7 | pos = e1;↵ | | 7 | pos = e1;↵
|
8 | } | | 8 | }
|
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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 38 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 6 |
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) | 6.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
37 | if (insertLink) | | 22 | if (insertLink) |
38 | String email = s.substring(s1, e1); | | 23 | String url = s.substring(s1, e1); |
39 | String link = "<a href=\"mailto:" + email + "\">" + email + "</a>"; | | 24 | String link = "<a href=\"" + url + "\">" + url + "</a>"; |
40 | buf.append(s.substring(pos, s1)); | | 25 | buf.append(s.substring(pos, s1)); |
41 | | | 26 | |
42 | | | 27 | |
Precondition Violations (0)
Row |
Violation |