if(x + offsetX + size.width + win.getX() > screenSize.width && x + offsetX + win.getX() >= size.width) { //System.err.println("x overflow"); if(point) x -= (size.width + extraOffset); else x = (win.getWidth() - size.width - offsetX + extraOffset); } else { x += extraOffset; }
if(y + offsetY + size.height + win.getY() > screenSize.height && y + offsetY + win.getY() >= size.height) { if(point) y = (win.getHeight() - size.height - offsetY + extraOffset); else y = -size.height - 1; } else { y += extraOffset; }
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 showPopupMenu(JPopupMenu, Component, int, int, boolean) Method name: void showPopupMenu(JPopupMenu, Component, int, int, boolean)
Number of AST nodes: 5 Number of AST nodes: 5
1
if(x + offsetX + size.width + win.getX() > screenSize.width
1
if(y + offsetY + size.height + win.getY() > screenSize.height
2
				&& x + offsetX + win.getX() >= size.width)
2
				&& y + offsetY + win.getY() >= size.height)
3
			{
3
			{
4
				//System.err.println("x overflow");
4
				
5
				if(point)
6
					x -= (size.width
5
if(point)
7
 + extraOffset);
6
					y = (win.getHeight() - size.height - offsetY + extraOffset);
8
				else
7
				else
9
					x = (win.getWidth() - size.width - offsetX + extraOffset);
8
					y = -size.height - 1;
10
			}
9
			}
11
			else
10
			else
12
			{
11
			{
13
				x += extraOffset;
12
				y += extraOffset;
14
			}
13
			}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.9
Clones locationClones are in the same method
Number of node comparisons15
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)7.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    12
    if (x + offsetX + size.width + win.getX() > screenSize.width && x + offsetX + win.getX() >= size.width)
    12
    if (x + offsetX + size.width + win.getX() > screenSize.width && x + offsetX + win.getX() >= size.width)
    17
    if (y + offsetY + size.height + win.getY() > screenSize.height && y + offsetY + win.getY() >= size.height)
    Differences
    Expression1Expression2Difference
    widthheightVARIABLE_NAME_MISMATCH
    getXgetYMETHOD_INVOCATION_NAME_MISMATCH
    xyVARIABLE_NAME_MISMATCH
    offsetXoffsetYVARIABLE_NAME_MISMATCH
    widthheightVARIABLE_NAME_MISMATCH
    getXgetYMETHOD_INVOCATION_NAME_MISMATCH
    xyVARIABLE_NAME_MISMATCH
    offsetXoffsetYVARIABLE_NAME_MISMATCH
    widthheightVARIABLE_NAME_MISMATCH
    17
    if (y + offsetY + size.height + win.getY() > screenSize.height && y + offsetY + win.getY() >= size.height)
    13
    if (point)
    18
    if (point)
    14
    x -= (size.width + extraOffset);
                                                                        
                                                                                                                                
    19
    y = (win.getHeight() - size.height - offsetY + extraOffset);
    else
    else
    15
    x = (win.getWidth() - size.width - offsetX + extraOffset);
    15
    x = (win.getWidth() - size.width - offsetX + extraOffset);
    20
    y = -size.height - 1;
    Differences
    Expression1Expression2Difference
    xyVARIABLE_NAME_MISMATCH
    (win.getWidth() - size.width - offsetX + extraOffset)-size.height - 1TYPE_COMPATIBLE_REPLACEMENT
    20
    y = -size.height - 1;
    else
    else
    16
    x += extraOffset;
    16
    x += extraOffset;
    21
    y += extraOffset;
    Differences
    Expression1Expression2Difference
    xyVARIABLE_NAME_MISMATCH
    21
    y += extraOffset;
    Precondition Violations (0)
    Row Violation