for (int pnlIdx = 0; pnlIdx < pnls.length; ++pnlIdx) { _panels.add(pnls[pnlIdx]); }
for (int i = 0; i < urls.length; ++i) { s_log.debug("Plugin class loader URL[" + i + "] = " + urls[i]); }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/preferences/GlobalPreferencesSheet.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/plugin/PluginManager.java
Method name: void createGUI() Method name: void loadPlugins()
Number of AST nodes: 2 Number of AST nodes: 2
1
for (int pnlIdx = 0; pnlIdx < pnls.length; ++pnlIdx)
1
for (int i = 0; i < urls.length; ++
2
					{
3
						_panels.add(pnls[pnlIdx
2
i)
3
			{
4
]);
4
				s_log.debug("Plugin class loader URL[" + i + "] = " + urls[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.3
Clones locationClones are in different classes
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    14
    for (int pnlIdx = 0; pnlIdx < pnls.length; ++pnlIdx)
    14
    for (int pnlIdx = 0; pnlIdx < pnls.length; ++pnlIdx)
    16
    for (int i = 0; i < urls.length; ++i)
    Differences
    Expression1Expression2Difference
    pnlIdxiVARIABLE_NAME_MISMATCH
    pnlIdxiVARIABLE_NAME_MISMATCH
    pnlsurlsVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.client.preferences.IGlobalPreferencesPanel[]java.net.URL[]VARIABLE_TYPE_MISMATCH
    pnlIdxiVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type int of variable pnls.length does not match with type int of variable urls.length
    • Make classes net.sourceforge.squirrel_sql.client.preferences.IGlobalPreferencesPanel[] and java.net.URL[] extend a common superclass
    16
    for (int i = 0; i < urls.length; ++i)
    15
    _panels.add(pnls[pnlIdx]);
    15
    _panels.add(pnls[pnlIdx]);
    Preondition Violations
    Unmatched statement _panels.add(pnls[pnlIdx]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                
                                                                                                                                        
    17
    s_log.debug("Plugin class loader URL[" + i + "] = " + urls[i]);
    Preondition Violations
    Unmatched statement s_log.debug("Plugin class loader URL[" + i + "] = "+ urls[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    17
    s_log.debug("Plugin class loader URL[" + i + "] = " + urls[i]);
    Precondition Violations (4)
    Row Violation
    1Type int of variable pnls.length does not match with type int of variable urls.length
    2Unmatched statement _panels.add(pnls[pnlIdx]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement s_log.debug("Plugin class loader URL[" + i + "] = "+ urls[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