for (int i = 0; i < graphComponents.size(); i++) { GraphComponent graphComponent = graphComponents.elementAt(i); if(graphComponent instanceof ConstraintView) { ConstraintView constraintView = (ConstraintView)graphComponents.elementAt(i); if(constraintView.hitMe(e)) { return constraintView; } } }
for (int i = 0; i < _constraints.size(); i++) { MssqlConstraint constraint = _constraints.get(i); if (constraint instanceof DefaultConstraint) { DefaultConstraint def = (DefaultConstraint) constraint; if (def.constrainsColumn(columnName)) results.add(def); } }
Clone fragments detected by clone detection tool
File path: /sql12/plugins/graph/src/net/sourceforge/squirrel_sql/plugins/graph/GraphDesktopController.java File path: /sql12/plugins/mssql/src/net/sourceforge/squirrel_sql/plugins/mssql/sql/constraint/TableConstraints.java
Method name: ConstraintView findHit(MouseEvent) Method name: List getDefaultsForColumn(String)
Number of AST nodes: 6 Number of AST nodes: 6
1
for (int i = 0; i < graphComponents.size(); i++)
1
for (int i = 0; i < _constraints.size(); i++)
2
      {
2
 {
3
         GraphComponent graphComponent = graphComponents.elementAt(i);
3
            MssqlConstraint constraint = _constraints.get(i);
4
         if(graphComponent instanceof ConstraintView)
4
            if (constraint instanceof DefaultConstraint) {
5
         {
5
         
6
            ConstraintView constraintView = (ConstraintView)graphComponents.elementAt(i);
6
       
7
DefaultConstraint def = (DefaultConstraint) constraint;
7
            if(constraintView.hitMe(e))
8
                if (def.constrainsColumn(columnName))
8
            {
9
            
9
               return constraintView;
10
        results.add(def);
10
            }
11
            }
11
         }
12
  
12
      }
13
      }
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in different classes
Number of node comparisons1