for (int item = 0, itemCount = this.rows.size(); item < itemCount; item++) { row = (DefaultKeyedValues) this.rows.get(item); int columnIndex = row.getIndex(columnKey); if (columnIndex >= 0) { row.removeValue(columnIndex); } }
for (int item = 0, itemCount = this.rows.size(); item < itemCount; item++) { row = (KeyedObjects) this.rows.get(item); int colIndex = row.getIndex(columnKey); if (colIndex >= 0) { row.removeValue(colIndex); } }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/DefaultKeyedValues2D.java File path: /jfreechart-1.0.10/src/org/jfree/data/KeyedObjects2D.java
Method name: void removeValue(Comparable, Comparable) Method name: void removeObject(Comparable, Comparable)
Number of AST nodes: 5 Number of AST nodes: 5
1
for (int item = 0, itemCount = this.rows.size(); item < itemCount; 
1
for (int item = 0, itemCount = this.rows.size(); item < itemCount; 
2
                 item++) {
2
                 item++) {
3
                row = (DefaultKeyedValues) this.rows.get(item);
3
                row = (KeyedObjects) this.rows.get(item);
4
                int columnIndex = row.getIndex(columnKey);
4
                int colIndex = row.getIndex(columnKey);
5
                if (columnIndex >= 0) {
5
                if (colIndex >= 0) {
6
                    row.removeValue(columnIndex);
6
                    row.removeValue(colIndex);
7
                }
7
                }
8
            }
8
            }
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.4
Clones locationClones are in different classes
Number of node comparisons22
  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)16.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    20
    for (int item = 0, itemCount = this.rows.size(); item < itemCount; item++)
    25
    for (int item = 0, itemCount = this.rows.size(); item < itemCount; item++)
    21
    row = (DefaultKeyedValues)this.rows.get(item);
    21
    row = (DefaultKeyedValues)this.rows.get(item);
    26
    row = (KeyedObjects)this.rows.get(item);
    Differences
    Expression1Expression2Difference
    org.jfree.data.DefaultKeyedValuesorg.jfree.data.KeyedObjectsSUBCLASS_TYPE_MISMATCH
    org.jfree.data.DefaultKeyedValuesorg.jfree.data.KeyedObjectsSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression (DefaultKeyedValues)this.rows.get(item) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (KeyedObjects)this.rows.get(item) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    26
    row = (KeyedObjects)this.rows.get(item);
    22
    int columnIndex = row.getIndex(columnKey);
    22
    int columnIndex = row.getIndex(columnKey);
    27
    int colIndex = row.getIndex(columnKey);
    Differences
    Expression1Expression2Difference
    columnIndexcolIndexVARIABLE_NAME_MISMATCH
    org.jfree.data.DefaultKeyedValuesorg.jfree.data.KeyedObjectsSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression row cannot be unified with expression row , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public int getIndex(Comparable#RAW)
    27
    int colIndex = row.getIndex(columnKey);
    23
    if (columnIndex >= 0)
    23
    if (columnIndex >= 0)
    28
    if (colIndex >= 0)
    Differences
    Expression1Expression2Difference
    columnIndexcolIndexVARIABLE_NAME_MISMATCH
    28
    if (colIndex >= 0)
    24
    row.removeValue(columnIndex);
    24
    row.removeValue(columnIndex);
    29
    row.removeValue(colIndex);
    Differences
    Expression1Expression2Difference
    columnIndexcolIndexVARIABLE_NAME_MISMATCH
    org.jfree.data.DefaultKeyedValuesorg.jfree.data.KeyedObjectsSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression row cannot be unified with expression row , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public void removeValue(int)
    29
    row.removeValue(colIndex);
    Precondition Violations (4)
    Row Violation
    1Expression (DefaultKeyedValues)this.rows.get(item) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression (KeyedObjects)this.rows.get(item) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression row cannot be unified with expression row , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public int getIndex(Comparable#RAW)
    4Expression row cannot be unified with expression row , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public void removeValue(int)