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(); getEditPanes(vec,splitPane); EditPane[] ep = new EditPane[vec.size()]; vec.copyInto(ep); return ep;
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/bsh/NameSpace.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/View.java
Method name: String[] enumerationToStringArray(Enumeration) Method name: EditPane[] getEditPanes()
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() );
4
		String 
3
	getEditPanes(vec,splitPane);
5
[] sa = new String [ v.size() ];
4
			EditPane[] ep = new EditPane[vec.size()];
6
		v.copyInto( sa );
5
			vec.copyInto(ep);
7
		return sa;
6
			return ep;
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 in different classes
Number of node comparisons14
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment3
    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();
    4
    Vector vec = new Vector();
    Differences
    Expression1Expression2Difference
    vvecVARIABLE_NAME_MISMATCH
    4
    Vector vec = new Vector();
    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()];
    Preondition Violations
    Unmatched statement String[] sa=new String[v.size()]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                            
                                                                  
    5
    getEditPanes(vec, splitPane);
    Preondition Violations
    Unmatched statement getEditPanes(vec,splitPane); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    getEditPanes(vec, splitPane);
                                                                                        
    6
    EditPane[] ep = new EditPane[vec.size()];
    Preondition Violations
    Unmatched statement EditPane[] ep=new EditPane[vec.size()]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6
    EditPane[] ep = new EditPane[vec.size()];
    5
    v.copyInto(sa);
    5
    v.copyInto(sa);
    7
    vec.copyInto(ep);
    Differences
    Expression1Expression2Difference
    saepVARIABLE_NAME_MISMATCH
    java.lang.String[]org.gjt.sp.jedit.EditPane[]VARIABLE_TYPE_MISMATCH
    vvecVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type java.lang.String[] of variable sa does not match with type org.gjt.sp.jedit.EditPane[] of variable ep
    • Make classes java.lang.String[] and org.gjt.sp.jedit.EditPane[] extend a common superclass
    7
    vec.copyInto(ep);
    6
    return sa;
    6
    return sa;
    Preondition Violations
    Unmatched return sa;
                              
                              
    8
    return ep;
    Preondition Violations
    Unmatched return ep;
    8
    return ep;
    Precondition Violations (7)
    Row Violation
    1Unmatched 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
    2Unmatched statement String[] sa=new String[v.size()]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement getEditPanes(vec,splitPane); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement EditPane[] ep=new EditPane[vec.size()]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Type java.lang.String[] of variable sa does not match with type org.gjt.sp.jedit.EditPane[] of variable ep
    6Unmatched return sa;
    7Unmatched return ep;