if (addTest.isSelected()) { element.setProperty(new StringProperty(LDAPSampler.TEST, LDAPSampler.ADD)); element.setProperty(new StringProperty(LDAPSampler.BASE_ENTRY_DN, add.getText())); element.setProperty(new TestElementProperty(LDAPSampler.ARGUMENTS, tableAddPanel.createTestElement())); }
if (searchTest.isSelected()) { element.setProperty(new StringProperty(LDAPExtSampler.TEST, LDAPExtSampler.SEARCH)); element.setProperty(new StringProperty(LDAPExtSampler.SEARCHBASE, searchbase.getText())); element.setProperty(new StringProperty(LDAPExtSampler.SEARCHFILTER, searchfilter.getText())); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/ldap/config/gui/LdapConfigGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/ldap/config/gui/LdapExtConfigGui.java
Method name: void modifyTestElement(TestElement) Method name: void modifyTestElement(TestElement)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (addTest.isSelected()) {
1
if (searchTest.isSelected()) {
2
			element.setProperty(new StringProperty(LDAPSampler.TEST, LDAPSampler.ADD));
2
			element.setProperty(new StringProperty(LDAPExtSampler.TEST, LDAPExtSampler.SEARCH));
3
			element.setProperty(new StringProperty(LDAPSampler.BASE_ENTRY_DN, add.getText()));
3
			element.setProperty(new StringProperty(LDAPExtSampler.SEARCHBASE, searchbase.getText()));
4
			element.setProperty(new TestElementProperty(LDAPSampler.ARGUMENTS, tableAddPanel.createTestElement()));
4
			element.setProperty(new StringProperty(LDAPExtSampler.SEARCHFILTER, searchfilter.getText()));
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.1
Clones locationClones are in different classes having the same super class
Number of node comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)775.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    7
    if (addTest.isSelected())
    7
    if (addTest.isSelected())
    32
    if (searchTest.isSelected())
    Differences
    Expression1Expression2Difference
    addTestsearchTestVARIABLE_NAME_MISMATCH
    32
    if (searchTest.isSelected())
    8
    element.setProperty(new StringProperty(LDAPSampler.TEST, LDAPSampler.ADD));
    8
    element.setProperty(new StringProperty(LDAPSampler.TEST, LDAPSampler.ADD));
    33
    element.setProperty(new StringProperty(LDAPExtSampler.TEST, LDAPExtSampler.SEARCH));
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.protocol.ldap.sampler.LDAPSamplerorg.apache.jmeter.protocol.ldap.sampler.LDAPExtSamplerSUBCLASS_TYPE_MISMATCH
    org.apache.jmeter.protocol.ldap.sampler.LDAPSamplerorg.apache.jmeter.protocol.ldap.sampler.LDAPExtSamplerSUBCLASS_TYPE_MISMATCH
    ADDSEARCHVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression LDAPSampler cannot be unified with expression LDAPExtSampler , because common superclass org.apache.jmeter.samplers.AbstractSampler does not declare member(s) public static final java.lang.String TEST
    Expression LDAPSampler cannot be unified with expression LDAPExtSampler , because common superclass org.apache.jmeter.samplers.AbstractSampler does not declare member(s) public static final java.lang.String TEST
    33
    element.setProperty(new StringProperty(LDAPExtSampler.TEST, LDAPExtSampler.SEARCH));
    9
    element.setProperty(new StringProperty(LDAPSampler.BASE_ENTRY_DN, add.getText()));
    9
    element.setProperty(new StringProperty(LDAPSampler.BASE_ENTRY_DN, add.getText()));
    34
    element.setProperty(new StringProperty(LDAPExtSampler.SEARCHBASE, searchbase.getText()));
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.protocol.ldap.sampler.LDAPSamplerorg.apache.jmeter.protocol.ldap.sampler.LDAPExtSamplerSUBCLASS_TYPE_MISMATCH
    BASE_ENTRY_DNSEARCHBASEVARIABLE_NAME_MISMATCH
    addsearchbaseVARIABLE_NAME_MISMATCH
    34
    element.setProperty(new StringProperty(LDAPExtSampler.SEARCHBASE, searchbase.getText()));
    10
    element.setProperty(new TestElementProperty(LDAPSampler.ARGUMENTS, tableAddPanel.createTestElement()));
    10
    element.setProperty(new TestElementProperty(LDAPSampler.ARGUMENTS, tableAddPanel.createTestElement()));
    Preondition Violations
    Unmatched statement element.setProperty(new TestElementProperty(LDAPSampler.ARGUMENTS,tableAddPanel.createTestElement())); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                                                                                        
                                                                                                                                                                                                    
    35
    element.setProperty(new StringProperty(LDAPExtSampler.SEARCHFILTER, searchfilter.getText()));
    Preondition Violations
    Unmatched statement element.setProperty(new StringProperty(LDAPExtSampler.SEARCHFILTER,searchfilter.getText())); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    35
    element.setProperty(new StringProperty(LDAPExtSampler.SEARCHFILTER, searchfilter.getText()));
    Precondition Violations (4)
    Row Violation
    1Expression LDAPSampler cannot be unified with expression LDAPExtSampler , because common superclass org.apache.jmeter.samplers.AbstractSampler does not declare member(s) public static final java.lang.String TEST
    2Expression LDAPSampler cannot be unified with expression LDAPExtSampler , because common superclass org.apache.jmeter.samplers.AbstractSampler does not declare member(s) public static final java.lang.String TEST
    3Unmatched statement element.setProperty(new TestElementProperty(LDAPSampler.ARGUMENTS,tableAddPanel.createTestElement())); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement element.setProperty(new StringProperty(LDAPExtSampler.SEARCHFILTER,searchfilter.getText())); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted