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;
key3.set(FIELD, owner, name, desc); Item result = get(key3); if (result == null) { put122(FIELD, newClass(owner).index, newNameType(name, desc).index); result = new Item(index++, key3); 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 newField(String, String, String)
Number of AST nodes: 8 Number of AST nodes: 7
1
key.set(value);
1
key3.set(FIELD, owner, name, desc);
2
    Item result = get(key);
2
    Item result = get(key3);
3
    if (result == null) {
3
    if (result == null) {
4
      pool.put1(LONG).put8(value);
4
      put122(FIELD, newClass(owner).index, newNameType(name, desc).index);
5
      result = new Item(index, key);
5
      result = new Item(index++, key3);
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.1
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.5
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    key.set(value);
    1
    key.set(value);
    1
    key3.set(FIELD, owner, name, desc);
    Differences
    Expression1Expression2Difference
    keykey3VARIABLE_NAME_MISMATCH
    key.set(value)key3.set(FIELD,owner,name,desc)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression key.set(value) is a void method call, and thus it cannot be parameterized
    Expression key3.set(FIELD,owner,name,desc) is a void method call, and thus it cannot be parameterized
    1
    key3.set(FIELD, owner, name, desc);
    2
    Item result = get(key);
    2
    Item result = get(key);
    2
    Item result = get(key3);
    Differences
    Expression1Expression2Difference
    keykey3VARIABLE_NAME_MISMATCH
    2
    Item result = get(key3);
    3
    if (result == null)
    3
    if (result == null)
                                                                                                                                            
    4
    put122(FIELD, newClass(owner).index, newNameType(name, desc).index);
    Preondition Violations
    Unmatched statement put122(FIELD,newClass(owner).index,newNameType(name,desc).index); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4
    put122(FIELD, newClass(owner).index, newNameType(name, desc).index);
    4
    pool.put1(LONG).put8(value);
                                                                  
                                                                      
    5
    result = new Item(index++, key3);
    Preondition Violations
    Unmatched statement result=new Item(index++,key3); 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++, key3);
    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 (5)
    Row Violation
    1Expression key.set(value) is a void method call, and thus it cannot be parameterized
    2Expression key3.set(FIELD,owner,name,desc) is a void method call, and thus it cannot be parameterized
    3Unmatched statement put122(FIELD,newClass(owner).index,newNameType(name,desc).index); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement result=new Item(index++,key3); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched 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