Vector v = new Vector(); while ( e.hasMoreElements() ) v.addElement( e.nextElement() ); String [] sa = new String [ v.size() ]; v.copyInto( sa ); return sa;
Vector vec = new Vector(); getAllNamesAux( vec ); String [] names = new String [ vec.size() ]; vec.copyInto( names ); return names;
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/bsh/NameSpace.java File path: /jEdit-4.2/src/bsh/NameSpace.java
Method name: String[] enumerationToStringArray(Enumeration) Method name: String[] getAllNames()
Number of AST nodes: 6 Number of AST nodes: 5
1
Vector v = new Vector();
1
Vector vec = new Vector();
2
		while ( e.hasMoreElements() )
2
		
3
			v.addElement( e.nextElement() );
3
getAllNamesAux( vec );
4
		String [] sa = new String [ v.size() ];
4
		String [] names = new String [ vec.size() ];
5
		v.copyInto( sa );
5
		vec.copyInto( names );
6
		return sa;
6
		return names;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are declared in the same class
Number of node comparisons14
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    Vector v = new Vector();
    1
    Vector v = new Vector();
    1
    Vector vec = new Vector();
    Differences
    Expression1Expression2Difference
    vvecVARIABLE_NAME_MISMATCH
    1
    Vector vec = new Vector();
                                                  
    2
    getAllNamesAux(vec);
    Preondition Violations
    Unmatched statement getAllNamesAux(vec); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2
    getAllNamesAux(vec);
    2
    while (e.hasMoreElements())
                                                              
    3
    v.addElement(e.nextElement());
    3
    v.addElement(e.nextElement());
    Preondition Violations
    Unmatched statement v.addElement(e.nextElement()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                      
    4
    String[] sa = new String[v.size()];
    4
    String[] sa = new String[v.size()];
    3
    String[] names = new String[vec.size()];
    Differences
    Expression1Expression2Difference
    sanamesVARIABLE_NAME_MISMATCH
    vvecVARIABLE_NAME_MISMATCH
    3
    String[] names = new String[vec.size()];
    5
    v.copyInto(sa);
    5
    v.copyInto(sa);
    4
    vec.copyInto(names);
    Differences
    Expression1Expression2Difference
    sanamesVARIABLE_NAME_MISMATCH
    vvecVARIABLE_NAME_MISMATCH
    4
    vec.copyInto(names);
    6
    return sa;
    6
    return sa;
    5
    return names;
    Differences
    Expression1Expression2Difference
    sanamesVARIABLE_NAME_MISMATCH
    5
    return names;
    Precondition Violations (2)
    Row Violation
    1Unmatched statement getAllNamesAux(vec); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement v.addElement(e.nextElement()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted