if (dirContext == null) { throw new NamingException(CONTEXT_IS_NULL); } dirContext.modifyAttributes(string, mods);
if (router == null) { router = new ReportActionRouter(); router.populateCommandMap(); } return router;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/ldap/sampler/LdapExtClient.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/report/gui/action/ReportActionRouter.java
Method name: void modifyTest(DirContext, ModificationItem[], String) Method name: ReportActionRouter getInstance()
Number of AST nodes: 3 Number of AST nodes: 4
1
if (dirContext == null) {
1
if (router == null) {
2
			throw new NamingException(CONTEXT_IS_NULL);
2
			
3
		}
4
		dirContext.modifyAttributes(string, mods)
3
router = new ReportActionRouter();
4
			router.populateCommandMap();
5
		}
5
;
6
		return router;
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 fragment2
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)0.4
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (dirContext == null)
    1
    if (dirContext == null)
    1
    if (router == null)
    Differences
    Expression1Expression2Difference
    dirContextrouterVARIABLE_NAME_MISMATCH
    javax.naming.directory.DirContextorg.apache.jmeter.report.gui.action.ReportActionRouterVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type javax.naming.directory.DirContext of variable dirContext does not match with type org.apache.jmeter.report.gui.action.ReportActionRouter of variable router
    • Make classes javax.naming.directory.DirContext and org.apache.jmeter.report.gui.action.ReportActionRouter extend a common superclass
    1
    if (router == null)
                                                                          
    2
    router = new ReportActionRouter();
    2
    throw new NamingException(CONTEXT_IS_NULL);
    2
    throw new NamingException(CONTEXT_IS_NULL);
    Preondition Violations
    Unmatched throw new NamingException(CONTEXT_IS_NULL);
                                                                                                
                                                                  
    3
    router.populateCommandMap();
    3
    dirContext.modifyAttributes(string, mods);
                                                                                            
                                      
    4
    return router;
    Preondition Violations
    Unmatched return router;
    4
    return router;
    Precondition Violations (3)
    Row Violation
    1Type javax.naming.directory.DirContext of variable dirContext does not match with type org.apache.jmeter.report.gui.action.ReportActionRouter of variable router
    2Unmatched throw new NamingException(CONTEXT_IS_NULL);
    3Unmatched return router;