if (o instanceof CollectionProperty) { if (value != null) { return value.equals(((JMeterProperty) o).getObjectValue()); } } return false;
if (o instanceof MapProperty) { if (value != null) { return value.equals(((JMeterProperty) o).getObjectValue()); } } return false;
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: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (o instanceof CollectionProperty) {
1
if (o instanceof MapProperty) {
2
			if (value != null) {
2
			if (value != null) {
3
				return value.equals(((JMeterProperty) o).getObjectValue());
3
				return value.equals(((JMeterProperty) o).getObjectValue());
4
			}
4
			}
5
		}
5
		}
6
		return false;
6
		return false;
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.4
Clones locationClones are in different classes having the same super class
Number of node comparisons6
  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)1.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (o instanceof CollectionProperty)
    1
    if (o instanceof CollectionProperty)
    1
    if (o instanceof MapProperty)
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.testelement.property.CollectionPropertyorg.apache.jmeter.testelement.property.MapPropertySUBCLASS_TYPE_MISMATCH
    1
    if (o instanceof MapProperty)
    2
    if (value != null)
    2
    if (value != null)
    2
    if (value != null)
    Differences
    Expression1Expression2Difference
    java.util.Collectionjava.util.MapVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.Collection of variable value does not match with type java.util.Map of variable value
    • Make classes java.util.Collection and java.util.Map extend a common superclass
    2
    if (value != null)
    3
    return value.equals(((JMeterProperty)o).getObjectValue());
    3
    return value.equals(((JMeterProperty)o).getObjectValue());
    3
    return value.equals(((JMeterProperty)o).getObjectValue());
    Differences
    Expression1Expression2Difference
    java.util.Collectionjava.util.MapVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.Collection of variable value does not match with type java.util.Map of variable value
    • Make classes java.util.Collection and java.util.Map extend a common superclass
    3
    return value.equals(((JMeterProperty)o).getObjectValue());
    4
    return false;
    4
    return false;
    Precondition Violations (2)
    Row Violation
    1Type java.util.Collection of variable value does not match with type java.util.Map of variable value
    2Type java.util.Collection of variable value does not match with type java.util.Map of variable value