res.sampleStart(); ldap.modifyTest(getUserModAttributes(), getPropertyAsString(BASE_ENTRY_DN)); res.sampleEnd();
res.sampleStart(); ldap.createTest(getBasicAttributes(), getPropertyAsString(ADD)); res.sampleEnd(); ldap.deleteTest(getPropertyAsString(ADD));
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/ldap/sampler/LDAPSampler.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/ldap/sampler/LDAPSampler.java
Method name: void modifyTest(LdapClient, SampleResult) Method name: void addTest(LdapClient, SampleResult)
Number of AST nodes: 3 Number of AST nodes: 4
1
res.sampleStart();
1
res.sampleStart();
2
			ldap.modifyTest(getUserModAttributes(), getPropertyAsString(BASE_ENTRY_DN));
2
			ldap.createTest(getBasicAttributes(), getPropertyAsString(ADD));
3
			res.sampleEnd();
3
			res.sampleEnd();
4
			ldap.deleteTest(getPropertyAsString(ADD));
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 comparisons12
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    2
    res.sampleStart();
    5
    res.sampleStart();
    3
    ldap.modifyTest(getUserModAttributes(), getPropertyAsString(BASE_ENTRY_DN));
    3
    ldap.modifyTest(getUserModAttributes(), getPropertyAsString(BASE_ENTRY_DN));
    6
    ldap.createTest(getBasicAttributes(), getPropertyAsString(ADD));
    Differences
    Expression1Expression2Difference
    modifyTestcreateTestMETHOD_INVOCATION_NAME_MISMATCH
    getUserModAttributesgetBasicAttributesMETHOD_INVOCATION_NAME_MISMATCH
    javax.naming.directory.ModificationItem[]javax.naming.directory.BasicAttributesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression ldap.modifyTest(getUserModAttributes(),getPropertyAsString(BASE_ENTRY_DN)) is a void method call, and thus it cannot be parameterized
    Expression ldap.createTest(getBasicAttributes(),getPropertyAsString(ADD)) is a void method call, and thus it cannot be parameterized
    Type javax.naming.directory.ModificationItem[] of variable getUserModAttributes() does not match with type javax.naming.directory.BasicAttributes of variable getBasicAttributes()
    • Make classes javax.naming.directory.ModificationItem[] and javax.naming.directory.BasicAttributes extend a common superclass
    6
    ldap.createTest(getBasicAttributes(), getPropertyAsString(ADD));
    4
    res.sampleEnd();
    7
    res.sampleEnd();
                                                                                              
    8
    ldap.deleteTest(getPropertyAsString(ADD));
    Preondition Violations
    Unmatched statement ldap.deleteTest(getPropertyAsString(ADD)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8
    ldap.deleteTest(getPropertyAsString(ADD));
    Precondition Violations (4)
    Row Violation
    1Expression ldap.modifyTest(getUserModAttributes(),getPropertyAsString(BASE_ENTRY_DN)) is a void method call, and thus it cannot be parameterized
    2Expression ldap.createTest(getBasicAttributes(),getPropertyAsString(ADD)) is a void method call, and thus it cannot be parameterized
    3Type javax.naming.directory.ModificationItem[] of variable getUserModAttributes() does not match with type javax.naming.directory.BasicAttributes of variable getBasicAttributes()
    4Unmatched statement ldap.deleteTest(getPropertyAsString(ADD)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted