Vector<Script> buf = new Vector<Script>(); buf.addAll(Arrays.asList(m_scripts)); buf.remove(ix); m_scripts = buf.toArray(new Script[buf.size()]); refresh();
Vector<ColumnInfo> buf = new Vector<ColumnInfo>(); buf.addAll(Arrays.asList(_columnInfos)); buf.add(colInfo); _columnInfos = buf.toArray(new ColumnInfo[buf.size()]);
Clone fragments detected by clone detection tool
File path: /sql12/plugins/userscript/src/net/sourceforge/squirrel_sql/plugins/userscript/kernel/ScriptListTableModel.java File path: /sql12/plugins/graph/src/net/sourceforge/squirrel_sql/plugins/graph/ConstraintData.java
Method name: void remove(int) Method name: void addColumnInfo(ColumnInfo)
Number of AST nodes: 5 Number of AST nodes: 4
1
Vector<Script> buf = new Vector<Script>();
1
Vector<ColumnInfo> buf = new Vector<ColumnInfo>();
2
		buf.addAll(Arrays.asList(m_scripts));
2
      buf.addAll(Arrays.asList(
3
		buf.remove(ix);
4
		m_script
3
_columnInfos));
4
      buf.add(colInfo);
5
s = buf.toArray(new Script[buf.size()]);
5
      _columnInfos = buf.toArray(new ColumnInfo[buf.size()]);
6
		refresh();
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.0
Clones locationClones are in different classes
Number of node comparisons20
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                                          
    1
    Vector<ColumnInfo> buf = new Vector<ColumnInfo>();
    1
    Vector<Script> buf = new Vector<Script>();
                                                                                          
    2
    buf.addAll(Arrays.asList(m_scripts));
    2
    buf.addAll(Arrays.asList(m_scripts));
    2
    buf.addAll(Arrays.asList(_columnInfos));
    Differences
    Expression1Expression2Difference
    m_scripts_columnInfosVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.plugins.userscript.kernel.Script[]net.sourceforge.squirrel_sql.plugins.graph.ColumnInfo[]VARIABLE_TYPE_MISMATCH
    java.util.Listjava.util.ListVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.plugins.userscript.kernel.Script[] of variable m_scripts does not match with type net.sourceforge.squirrel_sql.plugins.graph.ColumnInfo[] of variable _columnInfos
    • Make classes net.sourceforge.squirrel_sql.plugins.userscript.kernel.Script[] and net.sourceforge.squirrel_sql.plugins.graph.ColumnInfo[] extend a common superclass
    Type java.util.List<net.sourceforge.squirrel_sql.plugins.userscript.kernel.Script> of variable Arrays.asList(m_scripts) does not match with type java.util.List<net.sourceforge.squirrel_sql.plugins.graph.ColumnInfo> of variable Arrays.asList(_columnInfos)
    • Make classes java.util.List and java.util.List extend a common superclass
    2
    buf.addAll(Arrays.asList(_columnInfos));
                                            
    3
    buf.add(colInfo);
    3
    buf.remove(ix);
                                        
                                                                                                                    
    4
    _columnInfos = buf.toArray(new ColumnInfo[buf.size()]);
    Preondition Violations
    Unmatched statement _columnInfos=buf.toArray(new ColumnInfo[buf.size()]); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4
    _columnInfos = buf.toArray(new ColumnInfo[buf.size()]);
    4
    m_scripts = buf.toArray(new Script[buf.size()]);
    4
    m_scripts = buf.toArray(new Script[buf.size()]);
    Preondition Violations
    Unmatched statement m_scripts=buf.toArray(new Script[buf.size()]); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                      
    5
    refresh();
                              
    Precondition Violations (4)
    Row Violation
    1Type net.sourceforge.squirrel_sql.plugins.userscript.kernel.Script[] of variable m_scripts does not match with type net.sourceforge.squirrel_sql.plugins.graph.ColumnInfo[] of variable _columnInfos
    2Type java.util.List<net.sourceforge.squirrel_sql.plugins.userscript.kernel.Script> of variable Arrays.asList(m_scripts) does not match with type java.util.List<net.sourceforge.squirrel_sql.plugins.graph.ColumnInfo> of variable Arrays.asList(_columnInfos)
    3Unmatched statement _columnInfos=buf.toArray(new ColumnInfo[buf.size()]); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement m_scripts=buf.toArray(new Script[buf.size()]); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted