/**
* Set column IDs
*
* @param c
* array of column IDs
*/
public void setColumns(String[] c) {
columns = new Vector();
// add array to vector
for (int i = 0; i < c.length; i++) {
columns.add(c[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/table/model/HeaderTableModel.java
|
|
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/tree/util/TreeNodeList.java
|
Method name: void setColumns(String[])
|
|
Method name: void TreeNodeList(String)
|
Number of AST nodes: 2
|
|
Number of AST nodes: 3
|
|
1 | /**
| | 1 | public TreeNodeList(String s) {
|
2 | * Set column IDs
| | 2 | list = new Vector();
|
3 | *
| | 3 |
|
4 | * @param c
| | 4 | StringTokenizer tok = new StringTokenizer(s, "/");
|
5 | * array of column IDs
| | 5 |
|
6 | */
| | 6 | while (tok.hasMoreTokens()) {
|
7 | public void setColumns(String[] c) {
| | 7 | String next = tok.nextToken();
|
8 | columns = new Vector();
| | 8 |
|
9 |
| | 9 | list.add(next);
|
10 | // add array to vector
| | 10 | }
|
11 | for (int i = 0; i < c.length; i++) {
| | 11 | } |
12 | columns.add(c[i]);
| | | |
13 | }
| | | |
14 | } | | | |
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 |
2 | for (int i = 0; i < c.length; i++) | | 3 | while (tok.hasMoreTokens()) |
| | | 4 | String next = tok.nextToken(); |
3 | | | 5 | |
Precondition Violations (3)
Row |
Violation |
1 | Type java.lang.String[] of variable c does not match with type java.lang.String of variable s |
2 | Type java.lang.String[] of variable c does not match with type java.lang.String of variable s |
3 | Expression c[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted |