key.set(value); Item result = get(key); if (result == null) { pool.put1(LONG).put8(value); result = new Item(index, key); put(result); index += 2; } return result;
key.set(value); Item result = get(key); if (result == null) { pool.put1(FLOAT).put4(Float.floatToIntBits(value)); result = new Item(index++, key); put(result); } return result;
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/objectweb/asm/ClassWriter.java File path: /jEdit-4.2/src/org/objectweb/asm/ClassWriter.java
Method name: Item newLong(long) Method name: Item newFloat(float)
Number of AST nodes: 8 Number of AST nodes: 7
1
key.set(value);
1
key.set(value);
2
    Item result = get(key);
2
    Item result = get(key);
3
    if (result == null) {
3
    if (result == null) {
4
      pool.put1(LONG).put8(value);
4
      pool.put1(FLOAT).put4(Float.floatToIntBits(value));
5
      result = new Item(index, key);
5
      result = new Item(index++, key);
6
      put(result);
6
      put(result);
7
      index += 2;
8
    }
7
    }
9
    return result;
8
    return result;
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.2
Clones locationClones are declared in the same class
Number of node comparisons29
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)2.4
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    key.set(value);
    1
    key.set(value);
    1
    key.set(value);
    Differences
    Expression1Expression2Difference
    longfloatVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type long of variable value does not match with type float of variable value
    1
    key.set(value);
    2
    Item result = get(key);
    2
    Item result = get(key);
    3
    if (result == null)
    3
    if (result == null)
                                                                                                                
    4
    pool.put1(FLOAT).put4(Float.floatToIntBits(value));
    4
    pool.put1(LONG).put8(value);
                                                                  
                                                                    
    5
    result = new Item(index++, key);
    Preondition Violations
    Unmatched statement result=new Item(index++,key); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    result = new Item(index++, key);
    5
    result = new Item(index, key);
    5
    result = new Item(index, key);
    Preondition Violations
    Unmatched statement result=new Item(index,key); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                
    6
    put(result);
    6
    put(result);
    7
    index += 2;
                            
    8
    return result;
    7
    return result;
    Precondition Violations (3)
    Row Violation
    1Type long of variable value does not match with type float of variable value
    2Unmatched statement result=new Item(index++,key); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement result=new Item(index,key); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted