if (parentBounds.width <= (dim.width + fudgeFactor))
{
dim.width = parentBounds.width - fudgeFactor;
pt.x = fudgeFactor / 2;
newComp.setSize(dim);
}
else
{
if ((pt.x + dim.width + fudgeFactor) > (parentBounds.width))
{
pt.x -= (pt.x + dim.width + fudgeFactor) - parentBounds.width;
}
}
if (parentBounds.width <= (dim.width + fudgeFactor))
{
dim.width = parentBounds.width - fudgeFactor;
pt.x = fudgeFactor / 2;
rdif.setSize(dim);
}
else
{
if ((pt.x + dim.width + fudgeFactor) > (parentBounds.width))
{
pt.x -= (pt.x + dim.width + fudgeFactor) - parentBounds.width;
}
}
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/CellDataPopup.java
|
|
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/DataSetViewerEditableTablePanel.java
|
Method name: void createAndShowDialog(JTable, MouseEvent, ColumnDisplayDefinition, boolean)
|
|
Method name: void insertRow()
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | if (parentBounds.width <= (dim.width + fudgeFactor))↵ | | 1 | if (parentBounds.width <= (dim.width + fudgeFactor))↵
|
2 | {↵ | | 2 | {↵
|
3 | dim.width = parentBounds.width - fudgeFactor;↵ | | 3 | dim.width = parentBounds.width - fudgeFactor;↵
|
4 | pt.x = fudgeFactor / 2;↵ | | 4 | pt.x = fudgeFactor / 2;↵
|
5 | newComp.setSize(dim);↵ | | 5 | rdif.setSize(dim);↵
|
6 | }↵ | | 6 | }↵
|
7 | else↵ | | 7 | else ↵
|
8 | {↵ | | 8 | {↵
|
9 | if ((pt.x + dim.width + fudgeFactor) > (parentBounds.width))↵ | | 9 | if ((pt.x + dim.width + fudgeFactor) > (parentBounds.width))↵
|
10 | {↵ | | 10 | {↵
|
11 | pt.x -= (pt.x + dim.width + fudgeFactor) - parentBounds.width;↵ | | 11 | pt.x -= (pt.x + dim.width + fudgeFactor) - parentBounds.width;↵
|
12 | }↵ | | 12 | }↵
|
13 | } | | 13 | }
|
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 | 20 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 6 |
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) | 11.3 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
44 | if (parentBounds.width <= (dim.width + fudgeFactor)) | | 21 | if (parentBounds.width <= (dim.width + fudgeFactor)) |
45 | dim.width = parentBounds.width - fudgeFactor; | | 22 | dim.width = parentBounds.width - fudgeFactor; |
46 | | | 23 | |
47 | | | 24 | |
| | | | |
48 | if ((pt.x + dim.width + fudgeFactor) > (parentBounds.width)) | | 25 | if ((pt.x + dim.width + fudgeFactor) > (parentBounds.width)) |
49 | pt.x -= (pt.x + dim.width + fudgeFactor) - parentBounds.width; | | 26 | pt.x -= (pt.x + dim.width + fudgeFactor) - parentBounds.width; |
Precondition Violations (0)
Row |
Violation |