File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/monitor/parser/MonitorHandler.java | File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/monitor/parser/MonitorHandler.java | |||
Method name: long parseLong(String)
|
Method name: int parseInt(String)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | long val = 0;↵ | 1 | int val = 0;↵ | |
2 | if (data.length() > 0) {↵ | 2 | if (data.length() > 0) {↵ | |
3 | try {↵ | 3 | try {↵ | |
4 | val = Long.parseLong(data);↵ | 4 | val = Integer.parseInt(data);↵ | |
5 | } catch (NumberFormatException e) {↵ | 5 | } catch (NumberFormatException e) {↵ | |
6 | val = 0;↵ | 6 | val = 0;↵ | |
7 | }↵ | 7 | }↵ | |
8 | }↵ | 8 | }↵ | |
9 | return val; | 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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 6 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 1.1 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||
---|---|---|---|---|---|---|---|---|
| 1 | int val = 0; | ||||||
1 | long val = 0; | | ||||||
2 | if (data.length() > 0) | 2 | if (data.length() > 0) | |||||
| 3 | try | ||||||
|
| 4 | val = Integer.parseInt(data); | |||||
3 | try | | ||||||
4 | val = Long.parseLong(data); |
| | |||||
|
| 5 | return val; | |||||
5 | return val; |
| |
Row | Violation |
---|---|
1 | Unmatched statement val=Integer.parseInt(data); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement val=Integer.parseInt(data); 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 statement val=Long.parseLong(data); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Unmatched statement val=Long.parseLong(data); 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 |
5 | Unmatched return val; |
6 | Unmatched return val; |
7 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero |