if (total_width != free_width) {
double dx = ((double)free_width) / ((double)total_width);
for (int c = 0; c < ncols; c++) {
col_widths[c] = (int) ((double)col_widths[c] * dx);
}
}
if (total_width != free_width) {
double dx = ((double)free_width) / ((double)total_width);
for (int c = 0; c < ncols; c++) {
col_widths[c] = (int) ((double)col_widths[c] * dx);
}
}
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/installer/VariableGridLayout.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/VariableGridLayout.java
|
Method name: void layoutContainer(Container)
|
|
Method name: void layoutContainer(Container)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | if (total_width != free_width) {↵ | | 1 | if (total_width != free_width) {↵
|
2 | double dx = ((double)free_width) / ((double)total_width);↵ | | 2 | double dx = ((double)free_width) / ((double)total_width);↵
|
3 | for (int c = 0; c < ncols; c++) {↵ | | 3 | for (int c = 0; c < ncols; c++) {↵
|
4 | col_widths[c] = (int) ((double)col_widths[c] * dx);↵ | | 4 | col_widths[c] = (int) ((double)col_widths[c] * dx);↵
|
5 | }↵ | | 5 | }↵
|
6 | } | | 6 | }
|
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.4 |
Clones location | Clones are in different classes |
Number of node comparisons | 21 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 2.9 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
26 | if (total_width != free_width) | | 26 | if (total_width != free_width) |
27 | double dx = ((double)free_width) / ((double)total_width); | | 27 | double dx = ((double)free_width) / ((double)total_width); |
28 | for (int c = 0; c < ncols; c++) | | 28 | for (int c = 0; c < ncols; c++) |
29 | col_widths[c] = (int)((double)col_widths[c] * dx); | | 29 | col_widths[c] = (int)((double)col_widths[c] * dx); |
Precondition Violations (0)
Row |
Violation |