if (prop instanceof IntegerProperty) { retVal = (((IntegerProperty) prop).getIntValue()); } else { try { retVal = Integer.parseInt(prop.getStringValue()); } catch (NumberFormatException e) { } } return retVal;
if (prop instanceof FloatProperty) { retVal = (((FloatProperty) prop).getFloatValue()); } else { try { retVal = Float.parseFloat(prop.getStringValue()); } catch (NumberFormatException e) { } } return retVal;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/control/ThroughputController.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/control/ThroughputController.java
Method name: int getMaxThroughputAsInt() Method name: float getPercentThroughputAsFloat()
Number of AST nodes: 5 Number of AST nodes: 5
1
if (prop instanceof IntegerProperty) {
1
if (prop instanceof FloatProperty) {
2
			retVal = (((IntegerProperty) prop).getIntValue());
2
			retVal = (((FloatProperty) prop).getFloatValue());
3
		} else {
3
		} else {
4
			try {
4
			try {
5
				retVal = Integer.parseInt(prop.getStringValue());
5
				retVal = Float.parseFloat(prop.getStringValue());
6
			} catch (NumberFormatException e) {
6
			} catch (NumberFormatException e) {
7
			}
7
			}
8
		}
8
		}
9
		return retVal;
9
		return retVal;
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.4
Clones locationClones are declared in the same class
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)1.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    if (prop instanceof IntegerProperty)
    3
    if (prop instanceof IntegerProperty)
    3
    if (prop instanceof FloatProperty)
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.testelement.property.IntegerPropertyorg.apache.jmeter.testelement.property.FloatPropertySUBCLASS_TYPE_MISMATCH
    3
    if (prop instanceof FloatProperty)
                                                                                                        
    4
    retVal = (((FloatProperty)prop).getFloatValue());
    Preondition Violations
    Unmatched statement retVal=(((FloatProperty)prop).getFloatValue()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4
    retVal = (((FloatProperty)prop).getFloatValue());
    4
    retVal = (((IntegerProperty)prop).getIntValue());
    4
    retVal = (((IntegerProperty)prop).getIntValue());
    Preondition Violations
    Unmatched statement retVal=(((IntegerProperty)prop).getIntValue()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                        
    5
    try
    5
    try
                                                                                                        
    6
    retVal = Float.parseFloat(prop.getStringValue());
    Preondition Violations
    Unmatched statement retVal=Float.parseFloat(prop.getStringValue()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement retVal=Float.parseFloat(prop.getStringValue()); 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
    6
    retVal = Float.parseFloat(prop.getStringValue());
    6
    retVal = Integer.parseInt(prop.getStringValue());
    6
    retVal = Integer.parseInt(prop.getStringValue());
    Preondition Violations
    Unmatched statement retVal=Integer.parseInt(prop.getStringValue()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement retVal=Integer.parseInt(prop.getStringValue()); 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
                                                                                                        
                                      
    7
    return retVal;
    Preondition Violations
    Unmatched return retVal;
    7
    return retVal;
    7
    return retVal;
    7
    return retVal;
    Preondition Violations
    Unmatched return retVal;
                                      
    Precondition Violations (8)
    Row Violation
    1Unmatched statement retVal=(((FloatProperty)prop).getFloatValue()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement retVal=(((IntegerProperty)prop).getIntValue()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement retVal=Float.parseFloat(prop.getStringValue()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement retVal=Float.parseFloat(prop.getStringValue()); 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
    5Unmatched statement retVal=Integer.parseInt(prop.getStringValue()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched statement retVal=Integer.parseInt(prop.getStringValue()); 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
    7Unmatched return retVal;
    8Unmatched return retVal;