if (!data.containsKey(key)) { HashTree newTree = createNewTree(); data.put(key, newTree); order.add(key); return newTree; }
if (!data.containsKey(key)) { HashTree newTree = createNewTree(); data.put(key, newTree); return newTree; }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/collections/ListedHashTree.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/collections/HashTree.java
Method name: HashTree add(Object) Method name: HashTree add(Object)
Number of AST nodes: 5 Number of AST nodes: 4
1
if (!data.containsKey(key)) {
1
if (!data.containsKey(key)) {
2
			HashTree newTree = createNewTree();
2
			HashTree newTree = createNewTree();
3
			data.put(key, newTree);
3
			data.put(key, newTree);
4
			order.add(key);
4
			
5
			return newTree;
5
return newTree;
6
		}
6
		}
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 in different classes having the same super class
Number of node comparisons20
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.3
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (!data.containsKey(key))
    1
    if (!data.containsKey(key))
    2
    HashTree newTree = createNewTree();
    2
    HashTree newTree = createNewTree();
    3
    data.put(key, newTree);
    3
    data.put(key, newTree);
    4
    order.add(key);
    4
    order.add(key);
    Preondition Violations
    Unmatched statement order.add(key); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                        
    5
    return newTree;
    4
    return newTree;
    Precondition Violations (2)
    Row Violation
    1Unmatched statement order.add(key); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Not all possible execution flows end in a return statement