if(desired.x < osbounds.x || desired.x+desired.width
> desired.x + osbounds.width)
{
if (desired.width > osbounds.width)
desired.width = osbounds.width;
desired.x = (osbounds.width - desired.width) / 2;
}
if(desired.y < osbounds.y || desired.y+desired.height
> osbounds.y + osbounds.height)
{
if (desired.height >= osbounds.height)
desired.height = osbounds.height;
desired.y = (osbounds.height - desired.height) / 2;
}
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/GUIUtilities.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/GUIUtilities.java
|
Method name: void adjustForScreenBounds(Rectangle)
|
|
Method name: void adjustForScreenBounds(Rectangle)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | if(desired.x < osbounds.x || desired.x+desired.width↵ | | 1 | if(desired.y < osbounds.y || desired.y+desired.height↵
|
2 | > desired.x + osbounds.width)↵ | | 2 | > osbounds.y + osbounds.height)↵
|
3 | {↵ | | 3 | {↵
|
4 | if (desired.width > osbounds.width)↵ | | 4 | if (desired.height >= osbounds.height)↵
|
5 | desired.width = osbounds.width;↵ | | 5 | desired.height = osbounds.height;↵
|
6 | desired.x = (osbounds.width - desired.width) / 2;↵ | | 6 | desired.y = (osbounds.height - desired.height) / 2;↵
|
7 | } | | 7 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 0 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in the same method |
Number of node comparisons | 1 |