public TreeNodeList(String[] str) {
for (int i = 0; i < str.length; i++) {
list.add(str[i]);
}
}
public TreeNodeList(String s) {
list = new Vector();
StringTokenizer tok = new StringTokenizer(s, "/");
while (tok.hasMoreTokens()) {
String next = tok.nextToken();
list.add(next);
}
}
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/tree/util/TreeNodeList.java
|
|
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/tree/util/TreeNodeList.java
|
Method name: void TreeNodeList(String[])
|
|
Method name: void TreeNodeList(String)
|
Number of AST nodes: 2
|
|
Number of AST nodes: 3
|
|
1 | public TreeNodeList(String[] str) {
| | 1 | public TreeNodeList(String s) {
|
2 | for (int i = 0; i < str.length; i++) {
| | 2 | list = new Vector();
|
3 | list.add(str[i]);
| | 3 |
|
4 | }
| | 4 | StringTokenizer tok = new StringTokenizer(s, "/");
|
5 | } | | 5 |
|
| | | 6 | while (tok.hasMoreTokens()) {
|
| | | 7 | String next = tok.nextToken();
|
| | | 8 |
|
| | | 9 | list.add(next);
|
| | | 10 | }
|
| | | 11 | } |
See real code fragment |
|
See real code fragment |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 0.0 |
Similarity Score | 0.500 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | for (int i = 0; i < str.length; i++) | | 3 | while (tok.hasMoreTokens()) |
| | | 4 | String next = tok.nextToken(); |
2 | | | 5 | |
Precondition Violations (3)
Row |
Violation |
1 | Type java.lang.String[] of variable str does not match with type java.lang.String of variable s |
2 | Type java.lang.String[] of variable str does not match with type java.lang.String of variable s |
3 | Expression str[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted |