if (_childList == null) { _childList = new TreeSet<ITableInfo>(); } _childList.add(tab);
if (children == null) { children = new ArrayList<ExplainRow>(); } children.add(row);
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: void addChild(ExplainRow)
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
		
4
ArrayList<ExplainRow>();
5
}
5
             }
6
		_childList.add(tab);
6
			 children.add(row);
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 statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.1
    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 or after the extracted code, because it has dependencies to/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 or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                    
    3
    _childList.add(tab);
    3
    _childList.add(tab);
    3
    children.add(row);
    Differences
    Expression1Expression2Difference
    tabrowVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.fw.sql.ITableInfonet.sourceforge.squirrel_sql.plugins.oracle.explainplan.ExplainPlanExecuter.ExplainPlanModel.ExplainRowVARIABLE_TYPE_MISMATCH
    _childListchildrenVARIABLE_NAME_MISMATCH
    java.util.SortedSetjava.util.ListVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.fw.sql.ITableInfo of variable tab does not match with type net.sourceforge.squirrel_sql.plugins.oracle.explainplan.ExplainPlanExecuter.ExplainPlanModel.ExplainRow of variable row
    • Make classes net.sourceforge.squirrel_sql.fw.sql.ITableInfo and net.sourceforge.squirrel_sql.plugins.oracle.explainplan.ExplainPlanExecuter.ExplainPlanModel.ExplainRow extend a common superclass
    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
    3
    children.add(row);
    Precondition Violations (6)
    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 or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement _childList=new TreeSet<ITableInfo>(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Type net.sourceforge.squirrel_sql.fw.sql.ITableInfo of variable tab does not match with type net.sourceforge.squirrel_sql.plugins.oracle.explainplan.ExplainPlanExecuter.ExplainPlanModel.ExplainRow of variable row
    5Type 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
    6The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.fw.sql.TableInfo and net.sourceforge.squirrel_sql.plugins.oracle.explainplan.ExplainPlanExecuter.ExplainPlanModel.ExplainRow do not have a common superclass