for (int i = 0; i < _iAliasPropertiesPanelControllers.size(); i++) { IAliasPropertiesPanelController aliasPropertiesController = _iAliasPropertiesPanelControllers.get(i); aliasPropertiesController.applyChanges(); } performClose();
for (int i = 0; i < m_printStreams.size(); i++) { PrintStream printStream = m_printStreams.elementAt(i); printStream.flush(); }
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/userscript/src/net/sourceforge/squirrel_sql/plugins/userscript/kernel/ScriptEnvironment.java
Method name: void onOK() Method name: void flushAll()
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
m_printStreams.size(); i++)
3
		{
4
			PrintStream printStream = m_printStreams.elementAt(i);
5
			printStream.flush();
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.8
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++)
    1
    for (int i = 0; i < m_printStreams.size(); i++)
    Differences
    Expression1Expression2Difference
    _iAliasPropertiesPanelControllersm_printStreamsVARIABLE_NAME_MISMATCH
    java.util.ArrayListjava.util.VectorSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression _iAliasPropertiesPanelControllers cannot be unified with expression m_printStreams , because common superclass java.util.RandomAccess does not declare member(s) public int size()
    1
    for (int i = 0; i < m_printStreams.size(); i++)
                                                                                                                  
    2
    PrintStream printStream = m_printStreams.elementAt(i);
    Preondition Violations
    Unmatched statement PrintStream printStream=m_printStreams.elementAt(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2
    PrintStream printStream = m_printStreams.elementAt(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
    printStream.flush();
    3
    aliasPropertiesController.applyChanges();
                                                                                            
    4
    performClose();
                                        
    Precondition Violations (4)
    Row Violation
    1Expression _iAliasPropertiesPanelControllers cannot be unified with expression m_printStreams , because common superclass java.util.RandomAccess does not declare member(s) public int size()
    2Unmatched statement PrintStream printStream=m_printStreams.elementAt(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched 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
    4The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero