if (o instanceof CollectionProperty) { if (value != null) { return value.equals(((JMeterProperty) o).getObjectValue()); } }
if (dirContext != null) { dirContext.close(); dirContext = null; }
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/protocol/ldap/sampler/LdapClient.java
Method name: boolean equals(Object) Method name: void disconnect()
Number of AST nodes: 3 Number of AST nodes: 3
1
if (o instanceof CollectionProperty) {
1
if (
2
			if (value != null) {
3
				return value.equals(((JMeterProperty) o).getObjectValu
2
dirContext != null) {
4
e());
3
				dirContext.close();
5
			}
4
				dirContext = null;
6
		}
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.1
Clones locationClones are in different classes
Number of node comparisons7
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.4
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    2
    if (value != null)
    2
    if (value != null)
    2
    if (dirContext != null)
    Differences
    Expression1Expression2Difference
    valuedirContextVARIABLE_NAME_MISMATCH
    java.util.Collectionjavax.naming.directory.DirContextVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.Collection of variable value does not match with type javax.naming.directory.DirContext of variable dirContext
    • Make classes java.util.Collection and javax.naming.directory.DirContext extend a common superclass
    2
    if (dirContext != null)
                                                
    3
    dirContext.close();
    Preondition Violations
    Unmatched statement dirContext.close(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement dirContext.close(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    3
    dirContext.close();
    3
    return value.equals(((JMeterProperty)o).getObjectValue());
    3
    return value.equals(((JMeterProperty)o).getObjectValue());
    Preondition Violations
    Unmatched statement return value.equals(((JMeterProperty)o).getObjectValue()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return value.equals(((JMeterProperty)o).getObjectValue());
                                                                                                                              
                                          
    4
    dirContext = null;
    Preondition Violations
    Unmatched statement dirContext=null; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4
    dirContext = null;
    Precondition Violations (7)
    Row Violation
    1Type java.util.Collection of variable value does not match with type javax.naming.directory.DirContext of variable dirContext
    2Unmatched statement dirContext.close(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement dirContext.close(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    4Unmatched statement return value.equals(((JMeterProperty)o).getObjectValue()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched return value.equals(((JMeterProperty)o).getObjectValue());
    6Unmatched statement dirContext=null; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero