if (!md5Result.equalsIgnoreCase(getAllowedMD5Hex())) { result.setFailure(true); Object[] arguments = { md5Result, getAllowedMD5Hex() }; String message = MessageFormat.format(JMeterUtils.getResString("md5hex_assertion_failure"), arguments); // $NON-NLS-1$ result.setFailureMessage(message); }
while (names.hasMoreElements()) { String prop = (String) names.nextElement(); if (prop.startsWith(name)) { Object o = instantiate(properties.getProperty(prop), "org.apache.jmeter.control.SamplerController"); // $NON-NLS-1$ v.addElement(o); } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/assertions/MD5HexAssertion.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/util/JMeterUtils.java
Method name: AssertionResult getResult(SampleResult) Method name: Vector getControllers(Properties)
Number of AST nodes: 5 Number of AST nodes: 5
1
if (!md5Result.equalsIgnoreCase(getAllowedMD5Hex())) {
2
			result.setFailure(true);
1
while (names.hasMoreElements()) {
2
			String prop = (String) names.nextElement();
3
			if (prop.startsWith(name)) {
3
			Object[] arguments = { md5Result, getAllowedMD5Hex() };
4
				Object
4
			String message = MessageFormat.format(JMeterUtils.getResString("md5hex_assertion_failure"), arguments); // $NON-NLS-1$
5
			result.setFailureMessage(message);
5
 o = instantiate(properties.getProperty(prop), 
6
						"org.apache.jmeter.control.SamplerController"); // $NON-NLS-1$
7
				v.addElement(o);
8
			}
6
		}
9
		}
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 comparisons15
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)0.8
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                          
    5
    String prop = (String)names.nextElement();
    Preondition Violations
    Unmatched statement String prop=(String)names.nextElement(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    String prop = (String)names.nextElement();
    15
    if (!md5Result.equalsIgnoreCase(getAllowedMD5Hex()))
    15
    if (!md5Result.equalsIgnoreCase(getAllowedMD5Hex()))
    6
    if (prop.startsWith(name))
    Differences
    Expression1Expression2Difference
    !md5Result.equalsIgnoreCase(getAllowedMD5Hex())prop.startsWith(name)TYPE_COMPATIBLE_REPLACEMENT
    6
    if (prop.startsWith(name))
                                                                                                                                                                                                            
    7
    Object o = instantiate(properties.getProperty(prop), "org.apache.jmeter.control.SamplerController");
                                          
    8
    v.addElement(o);
    16
    result.setFailure(true);
                                                            
    17
    Object[] arguments = {md5Result, getAllowedMD5Hex()};
                                                                                                                
    18
    String message = MessageFormat.format(JMeterUtils.getResString("md5hex_assertion_failure"), arguments);
                                                                                                                                                                                                                    
    19
    result.setFailureMessage(message);
                                                                                
    Precondition Violations (1)
    Row Violation
    1Unmatched statement String prop=(String)names.nextElement(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted