if (_childList == null) { _childList = new TreeSet<ITableInfo>(); } _childList.add(tab);
if (children == null) { children = new ArrayList<ExplainRow>(); } return Collections.enumeration(children);
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/sql/TableInfo.java File path: /sql12/plugins/oracle/src/net/sourceforge/squirrel_sql/plugins/oracle/explainplan/ExplainPlanExecuter.java
Method name: void addChild(ITableInfo) Method name: Enumeration children()
Number of AST nodes: 3 Number of AST nodes: 3
1
if (_childList == null)
1
if (children == null)
2
		{
2
 {
3
			_childList = new TreeSet<ITableInfo>();
3
				children = new 
4
		}
5
		_childList.add(tab
4
ArrayList<ExplainRow>();
5
             }
6
);
6
			 return Collections.enumeration(children);
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 comparisons5
  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.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (_childList == null)
    1
    if (_childList == null)
    1
    if (children == null)
    Differences
    Expression1Expression2Difference
    _childListchildrenVARIABLE_NAME_MISMATCH
    java.util.SortedSetjava.util.ListVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.SortedSet<net.sourceforge.squirrel_sql.fw.sql.ITableInfo> of variable _childList does not match with type java.util.List<net.sourceforge.squirrel_sql.plugins.oracle.explainplan.ExplainPlanExecuter.ExplainPlanModel.ExplainRow> of variable children
    • Make classes java.util.SortedSet and java.util.List extend a common superclass
    1
    if (children == null)
                                                                                    
    2
    children = new ArrayList<ExplainRow>();
    Preondition Violations
    Unmatched statement children=new ArrayList<ExplainRow>(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2
    children = new ArrayList<ExplainRow>();
    2
    _childList = new TreeSet<ITableInfo>();
    2
    _childList = new TreeSet<ITableInfo>();
    Preondition Violations
    Unmatched statement _childList=new TreeSet<ITableInfo>(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                    
                                                                                            
    3
    return Collections.enumeration(children);
    Preondition Violations
    Unmatched return Collections.enumeration(children);
    3
    return Collections.enumeration(children);
    3
    _childList.add(tab);
                                                  
    Precondition Violations (5)
    Row Violation
    1Type java.util.SortedSet<net.sourceforge.squirrel_sql.fw.sql.ITableInfo> of variable _childList does not match with type java.util.List<net.sourceforge.squirrel_sql.plugins.oracle.explainplan.ExplainPlanExecuter.ExplainPlanModel.ExplainRow> of variable children
    2Unmatched statement children=new ArrayList<ExplainRow>(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement _childList=new TreeSet<ITableInfo>(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched return Collections.enumeration(children);
    5The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero