Arrays.sort(_kids); for (AliasFolderState kid : _kids) { kid.sort(); }
if (columnDiffs != null && columnDiffs.size() > 0) { colDifferences.addAll(columnDiffs); for (ColumnDifference colDiff : columnDiffs) { System.out.println(colDiff.toString()); } }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/db/AliasFolderState.java File path: /sql12/plugins/dbdiff/src/net/sourceforge/squirrel_sql/plugins/dbdiff/DiffExecutor.java
Method name: void sort() Method name: void _execute()
Number of AST nodes: 3 Number of AST nodes: 4
1
Arrays.sort(_kids);
2
      for (AliasFolderState kid : _kids)
3
      {
4
         kid.sort();
1
if (columnDiffs != null && columnDiffs.size() > 0) {
2
                            colDifferences.addAll(columnDiffs);
3
                            for (ColumnDifference colDiff : columnDiffs) {
4
                                System.out.println(colDiff.toString());
5
                            }
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.2
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)1.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Arrays.sort(_kids);
                                                
                                                                                  
    23
    colDifferences.addAll(columnDiffs);
    2
    for (AliasFolderState kid : _kids)
    2
    for (AliasFolderState kid : _kids)
    24
    for (ColumnDifference colDiff : columnDiffs)
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.client.gui.db.AliasFolderStatenet.sourceforge.squirrel_sql.plugins.dbdiff.ColumnDifferenceVARIABLE_TYPE_MISMATCH
    _kidscolumnDiffsVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.client.gui.db.AliasFolderState[]java.util.ListVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.client.gui.db.AliasFolderState does not match with type net.sourceforge.squirrel_sql.plugins.dbdiff.ColumnDifference
    • Make classes net.sourceforge.squirrel_sql.client.gui.db.AliasFolderState and net.sourceforge.squirrel_sql.plugins.dbdiff.ColumnDifference extend a common superclass
    Type net.sourceforge.squirrel_sql.client.gui.db.AliasFolderState[] of variable _kids does not match with type java.util.List<net.sourceforge.squirrel_sql.plugins.dbdiff.ColumnDifference> of variable columnDiffs
    • Make classes net.sourceforge.squirrel_sql.client.gui.db.AliasFolderState[] and java.util.List extend a common superclass
    24
    for (ColumnDifference colDiff : columnDiffs)
    3
    kid.sort();
    3
    kid.sort();
    Preondition Violations
    Unmatched statement kid.sort(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                
                                                                                          
    25
    System.out.println(colDiff.toString());
    Preondition Violations
    Unmatched statement System.out.println(colDiff.toString()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    25
    System.out.println(colDiff.toString());
    Precondition Violations (6)
    Row Violation
    1Type net.sourceforge.squirrel_sql.client.gui.db.AliasFolderState does not match with type net.sourceforge.squirrel_sql.plugins.dbdiff.ColumnDifference
    2Type net.sourceforge.squirrel_sql.client.gui.db.AliasFolderState[] of variable _kids does not match with type java.util.List<net.sourceforge.squirrel_sql.plugins.dbdiff.ColumnDifference> of variable columnDiffs
    3Unmatched statement kid.sort(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement System.out.println(colDiff.toString()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Clone fragment #1 returns variable kid with type net.sourceforge.squirrel_sql.client.gui.db.AliasFolderState , while Clone fragment #2 returns variable colDiff with type net.sourceforge.squirrel_sql.plugins.dbdiff.ColumnDifference
    6The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero