try { retVal = Float.parseFloat(prop.getStringValue()); } catch (NumberFormatException e) { }
if (responseCode != null) { try { responseLevel = Integer.parseInt(responseCode) / 100; } catch (NumberFormatException numberFormatException) { // no need to change the foreground color } }
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/visualizers/ViewResultsFullVisualizer.java
Method name: float getPercentThroughputAsFloat() Method name: void valueChanged(TreeSelectionEvent)
Number of AST nodes: 2 Number of AST nodes: 3
1
try {
2
				retVal = Float.parseFloat(prop.getStringValue());
3
			} catch (NumberFormatException e) {
1
if (responseCode != null) {
2
						try {
3
							responseLevel = Integer.parseInt(responseCode) / 100;
4
						} catch (NumberFormatException numberFormatException) {
5
							// no need to change the foreground color
6
						}
4
			}
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
    43
    try
    Differences
    Expression1Expression2Difference
    enumberFormatExceptionVARIABLE_NAME_MISMATCH
    43
    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
                                                                                                        
                                                                                                                  
    44
    responseLevel = Integer.parseInt(responseCode) / 100;
    Preondition Violations
    Unmatched statement responseLevel=Integer.parseInt(responseCode) / 100; 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
    44
    responseLevel = Integer.parseInt(responseCode) / 100;
    Precondition Violations (2)
    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 responseLevel=Integer.parseInt(responseCode) / 100; 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