for (int i = 0; i < frames.length; ++i) { SwingUtilities.updateComponentTreeUI(frames[i]); frames[i].pack(); }
for (int i = 0; i < beans.length; ++i) { processBeanInfo(beans[i], info); }
Clone fragments detected by clone detection tool
File path: /sql12/plugins/laf/src/net/sourceforge/squirrel_sql/plugins/laf/LAFRegister.java File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/JavabeanArrayDataSet.java
Method name: void updateAllFrames() Method name: void setJavabeanArray(Object[])
Number of AST nodes: 3 Number of AST nodes: 2
1
for (int i = 0; i < frames.length; ++i)
1
for (int i = 0; i < beans.length; ++i)
2
			{
2
				{
3
				SwingUtilities.updateComponentTreeUI(frames[i]);
3
				
4
				frames[i].pack();
4
	processBeanInfo(beans[i], info);
5
			}
5
				}
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 comparisons7
  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 fragment1
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    3
    for (int i = 0; i < frames.length; ++i)
    3
    for (int i = 0; i < frames.length; ++i)
    10
    for (int i = 0; i < beans.length; ++i)
    Differences
    Expression1Expression2Difference
    framesbeansVARIABLE_NAME_MISMATCH
    java.awt.Frame[]java.lang.Object[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable frames.length does not match with type int of variable beans.length
    • Make classes java.awt.Frame[] and java.lang.Object[] extend a common superclass
    10
    for (int i = 0; i < beans.length; ++i)
    4
    SwingUtilities.updateComponentTreeUI(frames[i]);
    4
    SwingUtilities.updateComponentTreeUI(frames[i]);
    Preondition Violations
    Unmatched statement SwingUtilities.updateComponentTreeUI(frames[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                          
    5
    frames[i].pack();
    5
    frames[i].pack();
    Preondition Violations
    Unmatched statement frames[i].pack(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                            
                                                                          
    11
    processBeanInfo(beans[i], info);
    Preondition Violations
    Unmatched statement processBeanInfo(beans[i],info); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement processBeanInfo(beans[i],info); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    11
    processBeanInfo(beans[i], info);
    Precondition Violations (6)
    Row Violation
    1Type int of variable frames.length does not match with type int of variable beans.length
    2Unmatched statement SwingUtilities.updateComponentTreeUI(frames[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement frames[i].pack(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement processBeanInfo(beans[i],info); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement processBeanInfo(beans[i],info); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    6The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero