if (allNull) { 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); } } this.columnKeys.remove(columnKey); }
if (allNull) { 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); } } this.columnKeys.remove(columnKey); }
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: 7 Number of AST nodes: 7
1
if (allNull) {
1
if (allNull) {
2
            for (int item = 0, itemCount = this.rows.size(); item < itemCount; 
2
            for (int item = 0, itemCount = this.rows.size(); item < itemCount; 
3
                 item++) {
3
                 item++) {
4
                row = (DefaultKeyedValues) this.rows.get(item);
4
                row = (KeyedObjects) this.rows.get(item);
5
                int columnIndex = row.getIndex(columnKey);
5
                int colIndex = row.getIndex(columnKey);
6
                if (columnIndex >= 0) {
6
                if (colIndex >= 0) {
7
                    row.removeValue(columnIndex);
7
                    row.removeValue(colIndex);
8
                }
8
                }
9
            }
9
            }
10
            this.columnKeys.remove(columnKey);
10
            this.columnKeys.remove(columnKey);
11
        }
11
        }
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 comparisons18
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)1.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    19
    if (allNull)
    24
    if (allNull)
    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);
    Preondition Violations
    Unmatched statement row=(DefaultKeyedValues)this.rows.get(item); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                    
    22
    int columnIndex = row.getIndex(columnKey);
    22
    int columnIndex = row.getIndex(columnKey);
    Preondition Violations
    Unmatched statement int columnIndex=row.getIndex(columnKey); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                            
                                                                                        
    26
    row = (KeyedObjects)this.rows.get(item);
    Preondition Violations
    Unmatched statement row=(KeyedObjects)this.rows.get(item); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    26
    row = (KeyedObjects)this.rows.get(item);
                                                                                      
    27
    int colIndex = row.getIndex(columnKey);
    Preondition Violations
    Unmatched statement int colIndex=row.getIndex(columnKey); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    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);
    Preondition Violations
    Unmatched statement row.removeValue(columnIndex); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                      
                                                                
    29
    row.removeValue(colIndex);
    Preondition Violations
    Unmatched statement row.removeValue(colIndex); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    29
    row.removeValue(colIndex);
    25
    this.columnKeys.remove(columnKey);
    30
    this.columnKeys.remove(columnKey);
    Precondition Violations (6)
    Row Violation
    1Unmatched statement row=(DefaultKeyedValues)this.rows.get(item); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement int columnIndex=row.getIndex(columnKey); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement row=(KeyedObjects)this.rows.get(item); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement int colIndex=row.getIndex(columnKey); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement row.removeValue(columnIndex); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched statement row.removeValue(colIndex); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted