File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/testelement/property/AbstractProperty.java | File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/testelement/property/AbstractProperty.java | |||
Method name: int getIntValue()
|
Method name: long getLongValue()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | String val = getStringValue();↵ | 1 | String val = getStringValue();↵ | |
2 | if (val == null) {↵ | 2 | if (val == null) {↵ | |
3 | return 0;↵ | 3 | return 0;↵ | |
4 | }↵ | 4 | }↵ | |
5 | try {↵ | 5 | try {↵ | |
6 | return Integer.parseInt(val);↵ | 6 | return Long.parseLong(val);↵ | |
7 | } catch (NumberFormatException e) {↵ | 7 | } catch (NumberFormatException e) {↵ | |
8 | return 0;↵ | 8 | return 0;↵ | |
9 | } | 9 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 11 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 2.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||
---|---|---|---|---|---|---|---|---|---|
1 | String val = getStringValue(); | 1 | String val = getStringValue(); | ||||||
2 | if (val == null) | 2 | if (val == null) | ||||||
3 | return 0; | 3 | return 0; | ||||||
4 | try | 4 | try | ||||||
|
| 5 | return Long.parseLong(val); | ||||||
5 | return Integer.parseInt(val); |
| |
Row | Violation |
---|---|
1 | Unmatched statement return Long.parseLong(val); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement return Long.parseLong(val); 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 |
3 | Unmatched return Long.parseLong(val); |
4 | Unmatched statement return Integer.parseInt(val); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement return Integer.parseInt(val); 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 | Unmatched return Integer.parseInt(val); |
7 | Not all possible execution flows end in a return statement |