if (ext.equals(SaveGraphicsService.PNG_EXTENSION)) {
save.saveJComponent(name, SaveGraphicsService.PNG, comp);
} else if (ext.equals(SaveGraphicsService.TIFF_EXTENSION)) {
save.saveJComponent(name, SaveGraphicsService.TIFF, comp);
} else {
save.saveJComponent(filename, SaveGraphicsService.PNG, comp);
}
if (ext.equals(SaveGraphicsService.PNG_EXTENSION)) {
save.saveJComponent(name, SaveGraphicsService.PNG, comp);
} else if (ext.equals(SaveGraphicsService.TIFF_EXTENSION)) {
save.saveJComponent(name, SaveGraphicsService.TIFF, comp);
} else {
save.saveJComponent(filename, SaveGraphicsService.PNG, comp);
}
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/action/SaveGraphics.java
|
|
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/report/gui/action/ReportSaveGraphics.java
|
Method name: void saveImage(JComponent)
|
|
Method name: void doAction(ActionEvent)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (ext.equals(SaveGraphicsService.PNG_EXTENSION)) {↵ | | 1 | if (ext.equals(SaveGraphicsService.PNG_EXTENSION)) {↵
|
2 | save.saveJComponent(name, SaveGraphicsService.PNG, comp);↵ | | 2 | save.saveJComponent(name, SaveGraphicsService.PNG, comp);↵
|
3 | } else if (ext.equals(SaveGraphicsService.TIFF_EXTENSION)) {↵ | | 3 | } else if (ext.equals(SaveGraphicsService.TIFF_EXTENSION)) {↵
|
4 | save.saveJComponent(name, SaveGraphicsService.TIFF, comp);↵ | | 4 | save.saveJComponent(name, SaveGraphicsService.TIFF, comp);↵
|
5 | } else {↵ | | |
|
6 | ↵ | | 5 | } else {↵
|
7 | save.saveJComponent(filename, SaveGraphicsService.PNG, comp);↵ | | 6 | save.saveJComponent(filename, SaveGraphicsService.PNG, comp);↵
|
8 | } | | 7 | }
|
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.7 |
Clones location | Clones are in different classes |
Number of node comparisons | 21 |
-
{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) | 1.3 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
15 | if (ext.equals(SaveGraphicsService.PNG_EXTENSION)) | | 18 | if (ext.equals(SaveGraphicsService.PNG_EXTENSION)) |
16 | save.saveJComponent(name, SaveGraphicsService.PNG, comp); | | 19 | save.saveJComponent(name, SaveGraphicsService.PNG, comp); |
17 | else if (ext.equals(SaveGraphicsService.TIFF_EXTENSION)) | | 20 | else if (ext.equals(SaveGraphicsService.TIFF_EXTENSION)) |
18 | save.saveJComponent(name, SaveGraphicsService.TIFF, comp); | | 21 | save.saveJComponent(name, SaveGraphicsService.TIFF, comp); |
| | | | |
19 | save.saveJComponent(filename, SaveGraphicsService.PNG, comp); | | 22 | save.saveJComponent(filename, SaveGraphicsService.PNG, comp); |
Precondition Violations (0)
Row |
Violation |