JRootPane rp = _popupParent.getRootPane(); if (rp != null) { rp.getLayeredPane().add(c, JLayeredPane.POPUP_LAYER, 0); }
JRootPane rp = c.getRootPane(); if (rp != null) { rp.getLayeredPane().remove(c); }
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/completion/PopupManager.java File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/completion/PopupManager.java
Method name: void installToRootPane(JComponent) Method name: void removeFromRootPane(JComponent)
Number of AST nodes: 3 Number of AST nodes: 3
1
JRootPane rp = _popupParent.getRootPane();
1
JRootPane rp = c.getRootPane();
2
		if (rp != null)
2
		if (rp != null)
3
		{
3
		{
4
			rp.getLayeredPane().add(c, JLayeredPane.POPUP_LAYER, 0);
4
			rp.getLayeredPane().remove(c);
5
		}
5
		}
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.1
Clones locationClones are declared in the same class
Number of node comparisons5
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    JRootPane rp = _popupParent.getRootPane();
    1
    JRootPane rp = _popupParent.getRootPane();
    1
    JRootPane rp = c.getRootPane();
    Differences
    Expression1Expression2Difference
    _popupParentcVARIABLE_NAME_MISMATCH
    1
    JRootPane rp = c.getRootPane();
    2
    if (rp != null)
    2
    if (rp != null)
    3
    rp.getLayeredPane().add(c, JLayeredPane.POPUP_LAYER, 0);
    3
    rp.getLayeredPane().add(c, JLayeredPane.POPUP_LAYER, 0);
    3
    rp.getLayeredPane().remove(c);
    Differences
    Expression1Expression2Difference
    addremoveMETHOD_INVOCATION_NAME_MISMATCH
    rp.getLayeredPane().add(c,JLayeredPane.POPUP_LAYER,0)rp.getLayeredPane().remove(c)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression rp.getLayeredPane().add(c,JLayeredPane.POPUP_LAYER,0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression rp.getLayeredPane().remove(c) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression rp.getLayeredPane().add(c,JLayeredPane.POPUP_LAYER,0) is a void method call, and thus it cannot be parameterized
    Expression rp.getLayeredPane().remove(c) is a void method call, and thus it cannot be parameterized
    Expression rp.getLayeredPane().add(c,JLayeredPane.POPUP_LAYER,0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression rp.getLayeredPane().remove(c) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression rp.getLayeredPane().add(c,JLayeredPane.POPUP_LAYER,0) is a void method call, and thus it cannot be parameterized
    Expression rp.getLayeredPane().remove(c) is a void method call, and thus it cannot be parameterized
    3
    rp.getLayeredPane().remove(c);
    Precondition Violations (8)
    Row Violation
    1Expression rp.getLayeredPane().add(c,JLayeredPane.POPUP_LAYER,0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression rp.getLayeredPane().remove(c) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression rp.getLayeredPane().add(c,JLayeredPane.POPUP_LAYER,0) is a void method call, and thus it cannot be parameterized
    4Expression rp.getLayeredPane().remove(c) is a void method call, and thus it cannot be parameterized
    5Expression rp.getLayeredPane().add(c,JLayeredPane.POPUP_LAYER,0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression rp.getLayeredPane().remove(c) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression rp.getLayeredPane().add(c,JLayeredPane.POPUP_LAYER,0) is a void method call, and thus it cannot be parameterized
    8Expression rp.getLayeredPane().remove(c) is a void method call, and thus it cannot be parameterized