key.set(value); Item result = get(key); if (result == null) { pool.put1(INT).put4(value); result = new Item(index++, key); put(result); } return result;
key.set(UTF8, value, null, null); Item result = get(key); if (result == null) { pool.put1(UTF8).putUTF(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 newInteger(int) Method name: Item newUTF8(String)
Number of AST nodes: 7 Number of AST nodes: 7
1
key.set(value);
1
key.set(UTF8, value, null, null);
2
    Item result = get(key);
2
    Item result = get(key);
3
    if (result == null) {
3
    if (result == null) {
4
      pool.put1(INT).put4(value);
4
      pool.put1(UTF8).putUTF(value);
5
      result = new Item(index++, key);
5
      result = new Item(index++, key);
6
      put(result);
6
      put(result);
7
    }
7
    }
8
    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.1
Clones locationClones are declared in the same class
Number of node comparisons25
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)2.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    key.set(value);
    1
    key.set(value);
    1
    key.set(UTF8, value, null, null);
    Differences
    Expression1Expression2Difference
    key.set(value)key.set(UTF8,value,null,null)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression key.set(value) is a void method call, and thus it cannot be parameterized
    Expression key.set(UTF8,value,null,null) is a void method call, and thus it cannot be parameterized
    1
    key.set(UTF8, value, null, null);
    2
    Item result = get(key);
    2
    Item result = get(key);
    3
    if (result == null)
    3
    if (result == null)
                                                                      
    4
    pool.put1(UTF8).putUTF(value);
    4
    pool.put1(INT).put4(value);
                                                                
    5
    result = new Item(index++, key);
    5
    result = new Item(index++, key);
    6
    put(result);
    6
    put(result);
    7
    return result;
    7
    return result;
    Precondition Violations (2)
    Row Violation
    1Expression key.set(value) is a void method call, and thus it cannot be parameterized
    2Expression key.set(UTF8,value,null,null) is a void method call, and thus it cannot be parameterized