for(int i = 0; i < vfsUpdates.size(); i++) { EditBus.send((VFSUpdate)vfsUpdates.get(i)); }
for(int i = 0; i < vec.size(); i++) popup.add((JMenuItem)vec.get(i));
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/io/VFSManager.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/browser/VFSBrowser.java
Method name: void run() Method name: void createPopupMenu()
Number of AST nodes: 2 Number of AST nodes: 2
1
for(int i = 0; i < vfsUpdates.size(); i++)
1
for(int i = 0; i < vec.size(); i++)
2
				{
2
				
3
					EditBus.send((VFSUpdate)vfsUpdates.get(i));
3
	popup.add((JMenuItem)vec.get(i));
4
				}
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.3
Clones locationClones are in different classes
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    for (int i = 0; i < vfsUpdates.size(); i++)
    3
    for (int i = 0; i < vfsUpdates.size(); i++)
    27
    for (int i = 0; i < vec.size(); i++)
    Differences
    Expression1Expression2Difference
    vfsUpdatesvecVARIABLE_NAME_MISMATCH
    java.util.Listjava.util.ArrayListVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.List of variable vfsUpdates does not match with type java.util.ArrayList of variable vec
    • Make classes java.util.List and java.util.ArrayList extend a common superclass
    27
    for (int i = 0; i < vec.size(); i++)
    4
    EditBus.send((VFSUpdate)vfsUpdates.get(i));
    4
    EditBus.send((VFSUpdate)vfsUpdates.get(i));
    Preondition Violations
    Unmatched statement EditBus.send((VFSUpdate)vfsUpdates.get(i)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                
                                                                              
    28
    popup.add((JMenuItem)vec.get(i));
    Preondition Violations
    Unmatched statement popup.add((JMenuItem)vec.get(i)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    28
    popup.add((JMenuItem)vec.get(i));
    Precondition Violations (3)
    Row Violation
    1Type java.util.List of variable vfsUpdates does not match with type java.util.ArrayList of variable vec
    2Unmatched statement EditBus.send((VFSUpdate)vfsUpdates.get(i)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement popup.add((JMenuItem)vec.get(i)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted