if (total_height != free_height) {
double dy = (double)free_height / (double)total_height;
for (int r = 0; r < nrows; r++) {
row_heights[r] = (int) ((double)row_heights[r] * dy);
}
}
if (total_height != free_height) {
double dy = (double)free_height / (double)total_height;
for (int r = 0; r < nrows; r++) {
row_heights[r] = (int) ((double)row_heights[r] * dy);
}
}
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_height != free_height) {↵ | | 1 | if (total_height != free_height) {↵
|
2 | double dy = (double)free_height / (double)total_height;↵ | | 2 | double dy = (double)free_height / (double)total_height;↵
|
3 | for (int r = 0; r < nrows; r++) {↵ | | 3 | for (int r = 0; r < nrows; r++) {↵
|
4 | row_heights[r] = (int) ((double)row_heights[r] * dy);↵ | | 4 | row_heights[r] = (int) ((double)row_heights[r] * dy);↵
|
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.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 16 |
-
{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) | 1.8 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
22 | if (total_height != free_height) | | 22 | if (total_height != free_height) |
23 | double dy = (double)free_height / (double)total_height; | | 23 | double dy = (double)free_height / (double)total_height; |
24 | for (int r = 0; r < nrows; r++) | | 24 | for (int r = 0; r < nrows; r++) |
25 | row_heights[r] = (int)((double)row_heights[r] * dy); | | 25 | row_heights[r] = (int)((double)row_heights[r] * dy); |
Precondition Violations (0)
Row |
Violation |