for (int i = 0; i < _iAliasPropertiesPanelControllers.size(); i++) { IAliasPropertiesPanelController aliasPropertiesController = _iAliasPropertiesPanelControllers.get(i); aliasPropertiesController.applyChanges(); } performClose();
for (int i = 0; i < syntaxes.size(); i++) { SQLSyntax syntax = syntaxes.elementAt(i); syntax.addSQLTokenListener(tl); }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/db/aliasproperties/AliasPropertiesController.java File path: /sql12/plugins/syntax/src/net/sourceforge/squirrel_sql/plugins/syntax/netbeans/SyntaxFactory.java
Method name: void onOK() Method name: void addSQLTokenListeners(ISession, SQLTokenListener)
Number of AST nodes: 4 Number of AST nodes: 3
1
for (int i = 0; i < _iAliasPropertiesPanelControllers.size(); i++)
1
for (int i = 0; i < 
2
      {
3
         IAliasPropertiesPanelController aliasPropertiesController = _iAliasPropertiesPanelControllers.get(i);
4
         aliasPropertiesController.applyChanges();
5
      }
6
      performClose();
2
syntaxes.size(); i++)
3
			{
4
				SQLSyntax syntax = syntaxes.elementAt(i);
5
				syntax.addSQLTokenListener(tl);
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.6
Clones locationClones are in different classes
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)1.3
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    for (int i = 0; i < _iAliasPropertiesPanelControllers.size(); i++)
    1
    for (int i = 0; i < _iAliasPropertiesPanelControllers.size(); i++)
    8
    for (int i = 0; i < syntaxes.size(); i++)
    Differences
    Expression1Expression2Difference
    _iAliasPropertiesPanelControllerssyntaxesVARIABLE_NAME_MISMATCH
    java.util.ArrayListjava.util.VectorSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression _iAliasPropertiesPanelControllers cannot be unified with expression syntaxes , because common superclass java.util.RandomAccess does not declare member(s) public int size()
    8
    for (int i = 0; i < syntaxes.size(); i++)
    2
    IAliasPropertiesPanelController aliasPropertiesController = _iAliasPropertiesPanelControllers.get(i);
    2
    IAliasPropertiesPanelController aliasPropertiesController = _iAliasPropertiesPanelControllers.get(i);
    Preondition Violations
    Unmatched statement IAliasPropertiesPanelController aliasPropertiesController=_iAliasPropertiesPanelControllers.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                                                                                
    3
    aliasPropertiesController.applyChanges();
                                                                                            
                                                                                        
    9
    SQLSyntax syntax = syntaxes.elementAt(i);
    Preondition Violations
    Unmatched statement SQLSyntax syntax=syntaxes.elementAt(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    9
    SQLSyntax syntax = syntaxes.elementAt(i);
                                                                          
    10
    syntax.addSQLTokenListener(tl);
    4
    performClose();
                                        
    Precondition Violations (4)
    Row Violation
    1Expression _iAliasPropertiesPanelControllers cannot be unified with expression syntaxes , because common superclass java.util.RandomAccess does not declare member(s) public int size()
    2Unmatched statement IAliasPropertiesPanelController aliasPropertiesController=_iAliasPropertiesPanelControllers.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement SQLSyntax syntax=syntaxes.elementAt(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero