synchronized (this) { HashMap temp = (HashMap) map.clone(); temp.putAll(in); map = temp; }
synchronized (this) { HashMap temp = (HashMap) map.clone(); temp.clear(); map = temp; }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/util/FastHashMap.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/util/FastHashMap.java
Method name: void putAll(Map) Method name: void clear()
Number of AST nodes: 4 Number of AST nodes: 4
1
synchronized (this) {
1
synchronized (this) {
2
			HashMap temp = (HashMap) map.clone();
2
			HashMap temp = (HashMap) map.clone();
3
			temp.putAll(in);
3
			temp.clear();
4
			map = temp;
4
			map = temp;
5
		}
5
		}
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.0
Clones locationClones are declared in the same class
Number of node comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    synchronized (this)
    1
    synchronized (this)
    2
    HashMap temp = (HashMap)map.clone();
    2
    HashMap temp = (HashMap)map.clone();
    3
    temp.putAll(in);
    3
    temp.putAll(in);
    3
    temp.clear();
    Differences
    Expression1Expression2Difference
    putAllclearMETHOD_INVOCATION_NAME_MISMATCH
    temp.putAll(in)temp.clear()ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression temp.putAll(in) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression temp.clear() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression temp.putAll(in) is a void method call, and thus it cannot be parameterized
    Expression temp.clear() is a void method call, and thus it cannot be parameterized
    Expression temp.putAll(in) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression temp.clear() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression temp.putAll(in) is a void method call, and thus it cannot be parameterized
    Expression temp.clear() is a void method call, and thus it cannot be parameterized
    3
    temp.clear();
    4
    map = temp;
    4
    map = temp;
    Precondition Violations (8)
    Row Violation
    1Expression temp.putAll(in) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression temp.clear() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression temp.putAll(in) is a void method call, and thus it cannot be parameterized
    4Expression temp.clear() is a void method call, and thus it cannot be parameterized
    5Expression temp.putAll(in) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression temp.clear() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression temp.putAll(in) is a void method call, and thus it cannot be parameterized
    8Expression temp.clear() is a void method call, and thus it cannot be parameterized