/** * 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
	}
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Similarity Score0.500
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    for (int i = 0; i < c.length; i++)
    2
    for (int i = 0; i < c.length; i++)
    3
    while (tok.hasMoreTokens())
    Differences
    Expression1Expression2Difference
    i < c.lengthtok.hasMoreTokens()TYPE_COMPATIBLE_REPLACEMENT
    java.lang.String[]java.lang.StringVARIABLE_TYPE_MISMATCH
    java.lang.String[]java.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String[] of variable c does not match with type java.lang.String of variable s
    • Make classes java.lang.String[] and java.lang.String extend a common superclass
    Type java.lang.String[] of variable c does not match with type java.lang.String of variable s
    • Make classes java.lang.String[] and java.lang.String extend a common superclass
    3
    while (tok.hasMoreTokens())
                                                                  
    4
    String next = tok.nextToken();
    3
    columns.add(c[i]);
    3
    columns.add(c[i]);
    5
    list.add(next);
    Differences
    Expression1Expression2Difference
    c[i]nextTYPE_COMPATIBLE_REPLACEMENT
    columnslistVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression c[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    list.add(next);
    Precondition Violations (3)
    Row Violation
    1Type java.lang.String[] of variable c does not match with type java.lang.String of variable s
    2Type java.lang.String[] of variable c does not match with type java.lang.String of variable s
    3Expression c[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted