try { retVal = Integer.parseInt(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: int getMaxThroughputAsInt() Method name: void valueChanged(TreeSelectionEvent)
Number of AST nodes: 2 Number of AST nodes: 3
1
if (responseCode != null) {
1
try {
2
						try {
2
				retVal = Integer.parseInt(prop.getStringValue());
3
							responseLevel = Integer.parseInt(responseCode) / 100;
3
			} catch (NumberFormatException e) {
4
						} catch (NumberFormatException 
5
numberFormatException) {
6
							// no need to change the foreground color
7
						}
4
			}
8
					}
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 statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)64.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    try
    5
    try
    43
    try
    Differences
    Expression1Expression2Difference
    enumberFormatExceptionVARIABLE_NAME_MISMATCH
    43
    try
    6
    retVal = Integer.parseInt(prop.getStringValue());
    6
    retVal = Integer.parseInt(prop.getStringValue());
    44
    responseLevel = Integer.parseInt(responseCode) / 100;
    Differences
    Expression1Expression2Difference
    retValresponseLevelVARIABLE_NAME_MISMATCH
    Integer.parseInt(prop.getStringValue())Integer.parseInt(responseCode) / 100TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression Integer.parseInt(prop.getStringValue()) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression Integer.parseInt(responseCode) / 100 is a method call throwing 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
    1Expression Integer.parseInt(prop.getStringValue()) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    2Expression Integer.parseInt(responseCode) / 100 is a method call throwing exception(s) that should be caught by a try block that will be extracted