Vector vec = new Vector(); getAllNamesAux( vec ); String [] names = new String [ vec.size() ]; vec.copyInto( names ); return names;
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[] getAllNames() Method name: EditPane[] getEditPanes()
Number of AST nodes: 5 Number of AST nodes: 5
1
Vector vec = new Vector();
1
Vector vec = new Vector();
2
		getAllNamesAux( vec );
2
			get
3
		String [] names = new String [ 
3
EditPanes(vec,splitPane);
4
vec.size() ];
4
			EditPane[] ep = new EditPane[vec.size()];
5
		vec.copyInto( names );
5
			vec.copyInto(ep);
6
		return names;
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 comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Vector vec = new Vector();
    4
    Vector vec = new Vector();
    2
    getAllNamesAux(vec);
    2
    getAllNamesAux(vec);
    5
    getEditPanes(vec, splitPane);
    Differences
    Expression1Expression2Difference
    getAllNamesAuxgetEditPanesMETHOD_INVOCATION_NAME_MISMATCH
    getAllNamesAux(vec)getEditPanes(vec,splitPane)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression getAllNamesAux(vec) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression getEditPanes(vec,splitPane) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method getEditPanes
    Expression getAllNamesAux(vec) is a void method call, and thus it cannot be parameterized
    Expression getEditPanes(vec,splitPane) is a void method call, and thus it cannot be parameterized
    Expression getAllNamesAux(vec) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression getEditPanes(vec,splitPane) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method getEditPanes
    Expression getAllNamesAux(vec) is a void method call, and thus it cannot be parameterized
    Expression getEditPanes(vec,splitPane) is a void method call, and thus it cannot be parameterized
    5
    getEditPanes(vec, splitPane);
    3
    String[] names = new String[vec.size()];
    3
    String[] names = new String[vec.size()];
    Preondition Violations
    Unmatched statement String[] names=new String[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()];
    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()];
    4
    vec.copyInto(names);
    4
    vec.copyInto(names);
    7
    vec.copyInto(ep);
    Differences
    Expression1Expression2Difference
    namesepVARIABLE_NAME_MISMATCH
    java.lang.String[]org.gjt.sp.jedit.EditPane[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String[] of variable names 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);
    5
    return names;
    5
    return names;
    Preondition Violations
    Unmatched return names;
                                    
                              
    8
    return ep;
    Preondition Violations
    Unmatched return ep;
    8
    return ep;
    Precondition Violations (13)
    Row Violation
    1Expression getAllNamesAux(vec) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression getEditPanes(vec,splitPane) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression getAllNamesAux(vec) is a void method call, and thus it cannot be parameterized
    4Expression getEditPanes(vec,splitPane) is a void method call, and thus it cannot be parameterized
    5Expression getAllNamesAux(vec) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression getEditPanes(vec,splitPane) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression getAllNamesAux(vec) is a void method call, and thus it cannot be parameterized
    8Expression getEditPanes(vec,splitPane) is a void method call, and thus it cannot be parameterized
    9Unmatched statement String[] names=new String[vec.size()]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    10Unmatched 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
    11Type java.lang.String[] of variable names does not match with type org.gjt.sp.jedit.EditPane[] of variable ep
    12Unmatched return names;
    13Unmatched return ep;