try { retVal = Float.parseFloat(prop.getStringValue()); } catch (NumberFormatException e) { }
if (toType.equals(Class.class)) { try { return Class.forName(value.toString()); } catch (Exception e) { // don't do anything } }
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/jorphan/util/Converter.java
Method name: float getPercentThroughputAsFloat() Method name: Object convert(Object, Class)
Number of AST nodes: 2 Number of AST nodes: 3
1
try {
2
				retVal = Float.parseFloat(prop.get
1
if (toType.equals(Class.class)) {
2
			try {
3
StringValue());
3
				return Class.forName(value.toString());
4
			} catch (NumberFormatException e) {
4
			} catch (Exception e) {
5
			
5
				// don't do anything
6
			}
6
}
7
		}
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 comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    try
    5
    try
    24
    try
    Differences
    Expression1Expression2Difference
    java.lang.NumberFormatExceptionjava.lang.ExceptionSUBCLASS_TYPE_MISMATCH
    java.lang.NumberFormatExceptionjava.lang.ExceptionSUBCLASS_TYPE_MISMATCH
    24
    try
    6
    retVal = Float.parseFloat(prop.getStringValue());
    6
    retVal = Float.parseFloat(prop.getStringValue());
    Preondition Violations
    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
                                                                                                        
                                                                                          
    25
    return Class.forName(value.toString());
    Preondition Violations
    Unmatched statement return Class.forName(value.toString()); 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
    Unmatched return Class.forName(value.toString());
    25
    return Class.forName(value.toString());
    Precondition Violations (3)
    Row Violation
    1Unmatched 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
    2Unmatched statement return Class.forName(value.toString()); 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
    3Unmatched return Class.forName(value.toString());