Object[] list = getSelectedValues(); selection1 = new IBasicModelPartial[list.length]; for (int i = 0; i < list.length; i++) { selection1[i] = (IBasicModelPartial) list[i]; } dndAction = false;
Object[] list = getSelectedValues(); selection2 = new IBasicModelPartial[list.length]; for (int i = 0; i < list.length; i++) { selection2[i] = (IBasicModelPartial) list[i]; } dndAction = true;
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/list/AddressbookDNDListView.java File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/list/AddressbookDNDListView.java
Method name: void valueChanged(ListSelectionEvent) Method name: void valueChanged(ListSelectionEvent)
Number of AST nodes: 5 Number of AST nodes: 5
1
Object[] list = getSelectedValues();
1
Object[] list = getSelectedValues();
2
			selection1 = new IBasicModelPartial[list.length];
2
			selection2 = new IBasicModelPartial[list.length];
3
			for (int i = 0; i < list.length; i++) {
3
			for (int i = 0; i < list.length; i++) {
4
				selection1[i] = (IBasicModelPartial) list[i];
4
				selection2[i] = (IBasicModelPartial) list[i];
5
			}
5
			}
6
			dndAction = false;
6
			dndAction = true;
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 the same method
Number of node comparisons8
  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)0.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    Object[] list = getSelectedValues();
    7
    Object[] list = getSelectedValues();
    3
    selection1 = new IBasicModelPartial[list.length];
    3
    selection1 = new IBasicModelPartial[list.length];
    8
    selection2 = new IBasicModelPartial[list.length];
    Differences
    Expression1Expression2Difference
    selection1selection2VARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression selection1 is a field being modified, and thus it cannot be parameterized
    Expression selection2 is a field being modified, and thus it cannot be parameterized
    8
    selection2 = new IBasicModelPartial[list.length];
    4
    for (int i = 0; i < list.length; i++)
    9
    for (int i = 0; i < list.length; i++)
    5
    selection1[i] = (IBasicModelPartial)list[i];
    5
    selection1[i] = (IBasicModelPartial)list[i];
    10
    selection2[i] = (IBasicModelPartial)list[i];
    Differences
    Expression1Expression2Difference
    selection1selection2VARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression selection1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression selection2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    selection2[i] = (IBasicModelPartial)list[i];
    6
    dndAction = false;
    6
    dndAction = false;
    11
    dndAction = true;
    Differences
    Expression1Expression2Difference
    falsetrueLITERAL_VALUE_MISMATCH
    11
    dndAction = true;
    Precondition Violations (4)
    Row Violation
    1Expression selection1 is a field being modified, and thus it cannot be parameterized
    2Expression selection2 is a field being modified, and thus it cannot be parameterized
    3Expression selection1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression selection2 cannot be parameterized, because it has dependencies to/from statements that will be extracted