EditAction[] retVal = new EditAction[actions.size()]; Enumeration e = actions.elements(); int i = 0; while(e.hasMoreElements()) { retVal[i++] = (EditAction)e.nextElement(); } return retVal;
String[] retVal = new String[actions.size()]; Enumeration e = actions.keys(); int i = 0; while(e.hasMoreElements()) { retVal[i++] = (String)e.nextElement(); } return retVal;
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/ActionSet.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/ActionSet.java
Method name: EditAction[] getActions() Method name: String[] getActionNames()
Number of AST nodes: 6 Number of AST nodes: 6
1
EditAction[] retVal = new EditAction[actions.size()];
1
String[] retVal = new String[actions.size()];
2
		Enumeration e = actions.elements();
2
		Enumeration e = actions.keys();
3
		int i = 0;
3
		int i = 0;
4
		while(e.hasMoreElements())
4
		while(e.hasMoreElements())
5
		{
5
		{
6
			retVal[i++] = (EditAction)e.nextElement();
6
			retVal[i++] = (String)e.nextElement();
7
		}
7
		}
8
		return retVal;
8
		return retVal;
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.1
Clones locationClones are declared in the same class
Number of node comparisons20
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)1.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                
    1
    String[] retVal = new String[actions.size()];
    2
    EditAction[] retVal = new EditAction[actions.size()];
                                                                                                                
    3
    Enumeration e = actions.elements();
    3
    Enumeration e = actions.elements();
    2
    Enumeration e = actions.keys();
    Differences
    Expression1Expression2Difference
    elementskeysMETHOD_INVOCATION_NAME_MISMATCH
    2
    Enumeration e = actions.keys();
    4
    int i = 0;
    3
    int i = 0;
    5
    while (e.hasMoreElements())
    4
    while (e.hasMoreElements())
                                                                                  
    5
    retVal[i++] = (String)e.nextElement();
    Preondition Violations
    Unmatched statement retVal[i++]=(String)e.nextElement(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    retVal[i++] = (String)e.nextElement();
    6
    retVal[i++] = (EditAction)e.nextElement();
    6
    retVal[i++] = (EditAction)e.nextElement();
    Preondition Violations
    Unmatched statement retVal[i++]=(EditAction)e.nextElement(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                          
                                      
    6
    return retVal;
    Preondition Violations
    Unmatched return retVal;
    6
    return retVal;
    7
    return retVal;
    7
    return retVal;
    Preondition Violations
    Unmatched return retVal;
                                      
    Precondition Violations (5)
    Row Violation
    1Unmatched statement retVal[i++]=(String)e.nextElement(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement retVal[i++]=(EditAction)e.nextElement(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched return retVal;
    4Unmatched return retVal;
    5Clone fragment #1 returns variables e, i , while Clone fragment #2 returns variables e, i