while (iter.hasNext()) {
try {
Command com = (Command) iter.next();
if (com.getClass().getName().equals(className)) {
return com;
}
} catch (Exception err) {
log.error("", err);
}
}
while (iter.hasNext()) {
try {
Command com = (Command) iter.next();
if (com.getClass().getName().equals(className)) {
return com;
}
} catch (Exception err) {
log.error("", err);
}
}
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/action/ActionRouter.java
|
|
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/report/gui/action/ReportActionRouter.java
|
Method name: Command getAction(String, String)
|
|
Method name: Command getAction(String, String)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | while (iter.hasNext()) {↵ | | 1 | while (iter.hasNext()) {↵
|
2 | try {↵ | | 2 | try {↵
|
3 | Command com = (Command) iter.next();↵ | | 3 | Command com = (Command) iter.next();↵
|
4 | if (com.getClass().getName().equals(className)) {↵ | | 4 | if (com.getClass().getName().equals(className)) {↵
|
5 | return com;↵ | | 5 | return com;↵
|
6 | }↵ | | 6 | }↵
|
7 | } catch (Exception err) {↵ | | 7 | } catch (Exception err) {↵
|
8 | log.error("", err);↵ | | 8 | log.error("", err);↵
|
9 | }↵ | | 9 | }↵
|
10 | } | | 10 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.5 |
Clones location | Clones are in different classes |
Number of node comparisons | 9 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 4.9 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
3 | while (iter.hasNext()) | | 3 | while (iter.hasNext()) |
4 | | | 4 | |
5 | Command com = (Command)iter.next(); | | 5 | Command com = (Command)iter.next(); |
6 | if (com.getClass().getName().equals(className)) | | 6 | if (com.getClass().getName().equals(className)) |
7 | | | 7 | |
Precondition Violations (0)
Row |
Violation |