for (int i = 0; i < dbObjs.length; i++) { if (dbObjs[i] instanceof IProcedureInfo) { IProcedureInfo pi = (IProcedureInfo) dbObjs[i]; String sFunc = pi.getSimpleName(); ret.add(sFunc); } }
for (int i = 0; i < dbObjs.length; i++) { if (dbObjs[i] instanceof ITableInfo) { ITableInfo ti = (ITableInfo) dbObjs[i]; String sTable = PREFIX_SQLUSER + ti.getSimpleName(); ret.add(sTable); } }
Clone fragments detected by clone detection tool
File path: /sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/ScriptFunctionCommand.java File path: /sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/ScriptViewCommand.java
Method name: String[] getSelectedFunctions() Method name: String[] getSelectedViews()
Number of AST nodes: 5 Number of AST nodes: 5
1
for (int i = 0; i < dbObjs.length; i++)
1
for (int i = 0; i < dbObjs.length; i++)
2
      {
2
      {
3
         if (dbObjs[i] instanceof IProcedureInfo)
3
         if (dbObjs[i] instanceof ITableInfo)
4
         {
4
         {
5
            IProcedureInfo pi = (IProcedureInfo) dbObjs[i];
5
            ITableInfo ti = (ITableInfo) dbObjs[i];
6
            String sFunc = pi.getSimpleName();
6
            String sTable = PREFIX_SQLUSER + ti.getSimpleName();
7
            ret.add(sFunc);
7
            ret.add(sTable);
8
         }
8
         }
9
      }
9
      }
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 comparisons17
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    for (int i = 0; i < dbObjs.length; i++)
    3
    for (int i = 0; i < dbObjs.length; i++)
    4
    if (dbObjs[i] instanceof IProcedureInfo)
    4
    if (dbObjs[i] instanceof IProcedureInfo)
    4
    if (dbObjs[i] instanceof ITableInfo)
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.fw.sql.IProcedureInfonet.sourceforge.squirrel_sql.fw.sql.ITableInfoSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression dbObjs[i] instanceof IProcedureInfo cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression dbObjs[i] instanceof ITableInfo cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    if (dbObjs[i] instanceof ITableInfo)
    5
    IProcedureInfo pi = (IProcedureInfo)dbObjs[i];
    5
    IProcedureInfo pi = (IProcedureInfo)dbObjs[i];
    5
    ITableInfo ti = (ITableInfo)dbObjs[i];
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.fw.sql.IProcedureInfonet.sourceforge.squirrel_sql.fw.sql.ITableInfoSUBCLASS_TYPE_MISMATCH
    pitiVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.fw.sql.IProcedureInfonet.sourceforge.squirrel_sql.fw.sql.ITableInfoSUBCLASS_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.fw.sql.IProcedureInfonet.sourceforge.squirrel_sql.fw.sql.ITableInfoSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression (IProcedureInfo)dbObjs[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (ITableInfo)dbObjs[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    ITableInfo ti = (ITableInfo)dbObjs[i];
    6
    String sFunc = pi.getSimpleName();
    6
    String sFunc = pi.getSimpleName();
    6
    String sTable = PREFIX_SQLUSER + ti.getSimpleName();
    Differences
    Expression1Expression2Difference
    sFuncsTableVARIABLE_NAME_MISMATCH
    pi.getSimpleName()PREFIX_SQLUSER + ti.getSimpleName()TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression pi.getSimpleName() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression PREFIX_SQLUSER + ti.getSimpleName() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    String sTable = PREFIX_SQLUSER + ti.getSimpleName();
    7
    ret.add(sFunc);
    7
    ret.add(sFunc);
    7
    ret.add(sTable);
    Differences
    Expression1Expression2Difference
    sFuncsTableVARIABLE_NAME_MISMATCH
    7
    ret.add(sTable);
    Precondition Violations (6)
    Row Violation
    1Expression dbObjs[i] instanceof IProcedureInfo cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression dbObjs[i] instanceof ITableInfo cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression (IProcedureInfo)dbObjs[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression (ITableInfo)dbObjs[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression pi.getSimpleName() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression PREFIX_SQLUSER + ti.getSimpleName() cannot be parameterized, because it has dependencies to/from statements that will be extracted