DefaultMutableTreeNode ret = findNode(sqlAlias, (DefaultMutableTreeNode) tn.getChildAt(i)); if(null != ret) { return ret; }
TreePath ret = getPathToDbInfo(catalog, schema, objectMatcher, (ObjectTreeNode) startNode.getChildAt(i), useExpanders); if(null != ret) { return ret; }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/db/JTreeAliasesListImpl.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/ObjectTreeModel.java
Method name: DefaultMutableTreeNode findNode(SQLAlias, DefaultMutableTreeNode) Method name: TreePath getPathToDbInfo(String, String, FilterMatcher, ObjectTreeNode, boolean)
Number of AST nodes: 3 Number of AST nodes: 3
1
DefaultMutableTreeNode ret = findNode(sqlAlias, (DefaultMutableTreeNode) tn.getChildAt(i));
1
TreePath ret = getPathToDbInfo(catalog, schema, objectMatcher, (ObjectTreeNode) startNode.getChildAt(i)
2
, useExpanders);
2
         if(null != ret)
3
            if(null != ret)
3
         {
4
            {
4
            return ret;
5
               return ret;
5
         }
6
            }
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.6
Clones locationClones are in different classes
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    DefaultMutableTreeNode ret = findNode(sqlAlias, (DefaultMutableTreeNode)tn.getChildAt(i));
    4
    DefaultMutableTreeNode ret = findNode(sqlAlias, (DefaultMutableTreeNode)tn.getChildAt(i));
    Preondition Violations
    Unmatched statement DefaultMutableTreeNode ret=findNode(sqlAlias,(DefaultMutableTreeNode)tn.getChildAt(i)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                                                        
                                                                                                                                                                                                                                            
    15
    TreePath ret = getPathToDbInfo(catalog, schema, objectMatcher, (ObjectTreeNode)startNode.getChildAt(i), useExpanders);
    Preondition Violations
    Unmatched statement TreePath ret=getPathToDbInfo(catalog,schema,objectMatcher,(ObjectTreeNode)startNode.getChildAt(i),useExpanders); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    15
    TreePath ret = getPathToDbInfo(catalog, schema, objectMatcher, (ObjectTreeNode)startNode.getChildAt(i), useExpanders);
    5
    if (null != ret)
    5
    if (null != ret)
    16
    if (null != ret)
    Differences
    Expression1Expression2Difference
    javax.swing.tree.DefaultMutableTreeNodejavax.swing.tree.TreePathVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type javax.swing.tree.DefaultMutableTreeNode of variable ret does not match with type javax.swing.tree.TreePath of variable ret
    • Make classes javax.swing.tree.DefaultMutableTreeNode and javax.swing.tree.TreePath extend a common superclass
    16
    if (null != ret)
    6
    return ret;
    6
    return ret;
    Preondition Violations
    Unmatched statement return ret; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return ret;
                                
                                  
    17
    return ret;
    Preondition Violations
    Unmatched statement return ret; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return ret;
    17
    return ret;
    Precondition Violations (8)
    Row Violation
    1Unmatched statement DefaultMutableTreeNode ret=findNode(sqlAlias,(DefaultMutableTreeNode)tn.getChildAt(i)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement TreePath ret=getPathToDbInfo(catalog,schema,objectMatcher,(ObjectTreeNode)startNode.getChildAt(i),useExpanders); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Type javax.swing.tree.DefaultMutableTreeNode of variable ret does not match with type javax.swing.tree.TreePath of variable ret
    4Unmatched statement return ret; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched return ret;
    6Unmatched statement return ret; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7Unmatched return ret;
    8The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero