for (int i = 0; i < frames.length; ++i) { SwingUtilities.updateComponentTreeUI(frames[i]); frames[i].pack(); }
for (int i = 0; i < filters.length; ++i) { chooser.addChoosableFileFilter(filters[i]); }
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/gui/Dialogs.java
Method name: void updateAllFrames() Method name: File selectFileForWriting(Frame, FileExtensionFilter[], JComponent)
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 < filters.length; ++i)
2
			{
2
			{
3
				SwingUtilities.updateComponentTreeUI(frames[i]);
3
				
4
				frames[i].pack();
4
chooser.addChoosableFileFilter(filters[i]);
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 statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.8
    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)
    4
    for (int i = 0; i < filters.length; ++i)
    Differences
    Expression1Expression2Difference
    framesfiltersVARIABLE_NAME_MISMATCH
    java.awt.Frame[]net.sourceforge.squirrel_sql.fw.util.FileExtensionFilter[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable frames.length does not match with type int of variable filters.length
    • Make classes java.awt.Frame[] and net.sourceforge.squirrel_sql.fw.util.FileExtensionFilter[] extend a common superclass
    4
    for (int i = 0; i < filters.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();
    5
    chooser.addChoosableFileFilter(filters[i]);
    Differences
    Expression1Expression2Difference
    packaddChoosableFileFilterMETHOD_INVOCATION_NAME_MISMATCH
    frames[i]chooserTYPE_COMPATIBLE_REPLACEMENT
    frames[i].pack()chooser.addChoosableFileFilter(filters[i])ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression frames[i].pack() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression chooser.addChoosableFileFilter(filters[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression frames[i].pack() is a void method call, and thus it cannot be parameterized
    Expression chooser.addChoosableFileFilter(filters[i]) is a void method call, and thus it cannot be parameterized
    Expression frames[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression frames[i].pack() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression chooser.addChoosableFileFilter(filters[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression frames[i].pack() is a void method call, and thus it cannot be parameterized
    Expression chooser.addChoosableFileFilter(filters[i]) is a void method call, and thus it cannot be parameterized
    5
    chooser.addChoosableFileFilter(filters[i]);
    Precondition Violations (12)
    Row Violation
    1Type int of variable frames.length does not match with type int of variable filters.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
    3Expression frames[i].pack() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression chooser.addChoosableFileFilter(filters[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression frames[i].pack() is a void method call, and thus it cannot be parameterized
    6Expression chooser.addChoosableFileFilter(filters[i]) is a void method call, and thus it cannot be parameterized
    7Expression frames[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression frames[i].pack() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression chooser.addChoosableFileFilter(filters[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression frames[i].pack() is a void method call, and thus it cannot be parameterized
    11Expression chooser.addChoosableFileFilter(filters[i]) is a void method call, and thus it cannot be parameterized
    12Clone fragment #1 returns variables i , while Clone fragment #2 returns variables