int childCount = model.getChildCount(parent); for ( int i=0; i<childCount; i++) { Object child = model.getChild(parent, i); v.add((IFolder) child); getChildren(model, child, v); }
int childCount = model.getChildCount(parent); for (int i = 0; i < childCount; i++) { Object child = model.getChild(parent, i); v.add((IFolder) child); getChildren(model, child, v); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/facade/FolderFacade.java File path: /columba-1.4-src/contact/src/main/java/org/columba/contact/gui/box/FolderListMenu.java
Method name: void getChildren(AddressbookTreeModel, Object, Vector) Method name: void getChildren(AddressbookTreeModel, Object, Vector)
Number of AST nodes: 5 Number of AST nodes: 5
1
int childCount = model.getChildCount(parent);
1
int childCount = model.getChildCount(parent);
2
		for ( int i=0; i<childCount; i++) {
2
		for (int i = 0; i < childCount; i++) {
3
			Object child = model.getChild(parent, i);
3
			Object child = model.getChild(parent, i);
4
			v.add((IFolder) child);
4
			v.add((IFolder) child);
5
			
6
			getChildren(model, child, v);
5
			getChildren(model, child, v);
7
		}
6
		}
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 in different classes
Number of node comparisons17
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    int childCount = model.getChildCount(parent);
    1
    int childCount = model.getChildCount(parent);
    2
    for (int i = 0; i < childCount; i++)
    2
    for (int i = 0; i < childCount; i++)
    3
    Object child = model.getChild(parent, i);
    3
    Object child = model.getChild(parent, i);
    4
    v.add((IFolder)child);
    4
    v.add((IFolder)child);
    4
    v.add((IFolder)child);
    Differences
    Expression1Expression2Difference
    org.columba.addressbook.facade.IFolderorg.columba.addressbook.folder.IFolderSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression (IFolder)child cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (IFolder)child cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    v.add((IFolder)child);
    5
    getChildren(model, child, v);
    5
    getChildren(model, child, v);
    Precondition Violations (3)
    Row Violation
    1Expression (IFolder)child cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression (IFolder)child cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3The refactoring of the clones is infeasible, because classes org.columba.addressbook.facade.FolderFacade and org.columba.contact.gui.box.FolderListMenu do not have a common superclass