if(false == dockHandle.isClosed()) { dockHandle.storeDividerLocation(_split.getDividerLocation()); }
if(null != e.getNewLeadSelectionPath()) { scrollPathToVisible(e.getNewLeadSelectionPath()); }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/desktopcontainer/docktabdesktop/DockTabDesktopPane.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/ObjectTree.java
Method name: void onSaveApplicationState() Method name: void valueChanged(TreeSelectionEvent)
Number of AST nodes: 2 Number of AST nodes: 2
1
if(false == dockHandle.isClosed())
1
if(null != e.getNewLeadSelectionPath())
2
         {
2
            {
3
            dockHandle.storeDividerLocation(_split.getDividerLocation());
3
               scrollPathToVisible(e.getNewLeadSelectionPath());
4
         }
4
            }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are in different classes
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)7.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    if (false == dockHandle.isClosed())
    2
    if (false == dockHandle.isClosed())
    1
    if (null != e.getNewLeadSelectionPath())
    Differences
    Expression1Expression2Difference
    falsenullAST_TYPE_MISMATCH
    isClosedgetNewLeadSelectionPathMETHOD_INVOCATION_NAME_MISMATCH
    booleanjavax.swing.tree.TreePathVARIABLE_TYPE_MISMATCH
    dockHandleeVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.client.gui.desktopcontainer.docktabdesktop.DockHandlejavax.swing.event.TreeSelectionEventVARIABLE_TYPE_MISMATCH
    ==!=OPERATOR_MISMATCH
    Preondition Violations
    Type boolean of variable dockHandle.isClosed() does not match with type javax.swing.tree.TreePath of variable e.getNewLeadSelectionPath()
    Type net.sourceforge.squirrel_sql.client.gui.desktopcontainer.docktabdesktop.DockHandle of variable dockHandle does not match with type javax.swing.event.TreeSelectionEvent of variable e
    • Make classes net.sourceforge.squirrel_sql.client.gui.desktopcontainer.docktabdesktop.DockHandle and javax.swing.event.TreeSelectionEvent extend a common superclass
    1
    if (null != e.getNewLeadSelectionPath())
    3
    dockHandle.storeDividerLocation(_split.getDividerLocation());
    3
    dockHandle.storeDividerLocation(_split.getDividerLocation());
    2
    scrollPathToVisible(e.getNewLeadSelectionPath());
    Differences
    Expression1Expression2Difference
    getDividerLocationgetNewLeadSelectionPathMETHOD_INVOCATION_NAME_MISMATCH
    intjavax.swing.tree.TreePathVARIABLE_TYPE_MISMATCH
    _spliteVARIABLE_NAME_MISMATCH
    javax.swing.JSplitPanejavax.swing.event.TreeSelectionEventVARIABLE_TYPE_MISMATCH
    storeDividerLocationscrollPathToVisibleMETHOD_INVOCATION_NAME_MISMATCH
    dockHandleMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression e.getNewLeadSelectionPath() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type int of variable _split.getDividerLocation() does not match with type javax.swing.tree.TreePath of variable e.getNewLeadSelectionPath()
    Type javax.swing.JSplitPane of variable _split does not match with type javax.swing.event.TreeSelectionEvent of variable e
    • Make classes javax.swing.JSplitPane and javax.swing.event.TreeSelectionEvent extend a common superclass
    Expression dockHandle.storeDividerLocation(_split.getDividerLocation()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression scrollPathToVisible(e.getNewLeadSelectionPath()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression dockHandle.storeDividerLocation(_split.getDividerLocation()) is a void method call, and thus it cannot be parameterized
    Expression scrollPathToVisible(e.getNewLeadSelectionPath()) is a void method call, and thus it cannot be parameterized
    Expression dockHandle.storeDividerLocation(_split.getDividerLocation()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression scrollPathToVisible(e.getNewLeadSelectionPath()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression dockHandle.storeDividerLocation(_split.getDividerLocation()) is a void method call, and thus it cannot be parameterized
    Expression scrollPathToVisible(e.getNewLeadSelectionPath()) is a void method call, and thus it cannot be parameterized
    2
    scrollPathToVisible(e.getNewLeadSelectionPath());
    Precondition Violations (14)
    Row Violation
    1Type boolean of variable dockHandle.isClosed() does not match with type javax.swing.tree.TreePath of variable e.getNewLeadSelectionPath()
    2Type net.sourceforge.squirrel_sql.client.gui.desktopcontainer.docktabdesktop.DockHandle of variable dockHandle does not match with type javax.swing.event.TreeSelectionEvent of variable e
    3Expression e.getNewLeadSelectionPath() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type int of variable _split.getDividerLocation() does not match with type javax.swing.tree.TreePath of variable e.getNewLeadSelectionPath()
    5Type javax.swing.JSplitPane of variable _split does not match with type javax.swing.event.TreeSelectionEvent of variable e
    6Expression dockHandle.storeDividerLocation(_split.getDividerLocation()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression scrollPathToVisible(e.getNewLeadSelectionPath()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression dockHandle.storeDividerLocation(_split.getDividerLocation()) is a void method call, and thus it cannot be parameterized
    9Expression scrollPathToVisible(e.getNewLeadSelectionPath()) is a void method call, and thus it cannot be parameterized
    10Expression dockHandle.storeDividerLocation(_split.getDividerLocation()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression scrollPathToVisible(e.getNewLeadSelectionPath()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression dockHandle.storeDividerLocation(_split.getDividerLocation()) is a void method call, and thus it cannot be parameterized
    13Expression scrollPathToVisible(e.getNewLeadSelectionPath()) is a void method call, and thus it cannot be parameterized
    14The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.client.gui.desktopcontainer.docktabdesktop.DockTabDesktopPane and do not have a common superclass