for(int i = 0; i < vfsUpdates.size(); i++) { EditBus.send((VFSUpdate)vfsUpdates.get(i)); }
for(int i = 0; i < menuItems.size(); i++) { menu.add((JMenuItem)menuItems.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/menu/MacrosProvider.java
Method name: void run() Method name: void createMacrosMenu(JMenu, Vector, int)
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 < menuItems.size(); i++)
2
				{
2
		{
3
					EditBus.send((VFSUpdate)vfsUpdates.get(i));
3
			menu.add((JMenuItem)menuItems.get(i));
4
				}
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 comparisons4
  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.7
    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++)
    14
    for (int i = 0; i < menuItems.size(); i++)
    Differences
    Expression1Expression2Difference
    vfsUpdatesmenuItemsVARIABLE_NAME_MISMATCH
    java.util.Listjava.util.VectorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.List of variable vfsUpdates does not match with type java.util.Vector of variable menuItems
    • Make classes java.util.List and java.util.Vector extend a common superclass
    14
    for (int i = 0; i < menuItems.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
                                                                                                
                                                                                        
    15
    menu.add((JMenuItem)menuItems.get(i));
    Preondition Violations
    Unmatched statement menu.add((JMenuItem)menuItems.get(i)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    15
    menu.add((JMenuItem)menuItems.get(i));
    Precondition Violations (3)
    Row Violation
    1Type java.util.List of variable vfsUpdates does not match with type java.util.Vector of variable menuItems
    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 menu.add((JMenuItem)menuItems.get(i)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted