if (v instanceof Collection) { setCollection((Collection) v); }
if (v instanceof Map) { setMap((Map) v); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/testelement/property/CollectionProperty.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/testelement/property/MapProperty.java
Method name: void setObjectValue(Object) Method name: void setObjectValue(Object)
Number of AST nodes: 2 Number of AST nodes: 2
1
if (v instanceof Collection) {
1
if (v instanceof Map) {
2
			setCollection((Collection) v);
2
			setMap((Map) v);
3
		}
3
		}
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 in different classes having the same super class
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (v instanceof Collection)
    1
    if (v instanceof Collection)
    1
    if (v instanceof Map)
    Differences
    Expression1Expression2Difference
    java.util.Collectionjava.util.MapVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.Collection does not match with type java.util.Map
    • Make classes java.util.Collection and java.util.Map extend a common superclass
    1
    if (v instanceof Map)
    2
    setCollection((Collection)v);
    2
    setCollection((Collection)v);
    2
    setMap((Map)v);
    Differences
    Expression1Expression2Difference
    java.util.Collectionjava.util.MapVARIABLE_TYPE_MISMATCH
    setCollectionsetMapMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression (Collection)v cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (Map)v cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.util.Collection does not match with type java.util.Map
    • Make classes java.util.Collection and java.util.Map extend a common superclass
    Expression setCollection((Collection)v) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression setMap((Map)v) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression setCollection((Collection)v) is a void method call, and thus it cannot be parameterized
    Expression setMap((Map)v) is a void method call, and thus it cannot be parameterized
    2
    setMap((Map)v);
    Precondition Violations (8)
    Row Violation
    1Type java.util.Collection does not match with type java.util.Map
    2Expression (Collection)v cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression (Map)v cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type java.util.Collection does not match with type java.util.Map
    5Expression setCollection((Collection)v) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression setMap((Map)v) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression setCollection((Collection)v) is a void method call, and thus it cannot be parameterized
    8Expression setMap((Map)v) is a void method call, and thus it cannot be parameterized