for (int pnlIdx = 0; pnlIdx < pnls.length; ++pnlIdx) { _panels.add(pnls[pnlIdx]); }
if (value != null) { for (int i = 0; i < value.length; ++i) { _subFolders.add(value[i]); } }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/preferences/GlobalPreferencesSheet.java File path: /sql12/plugins/favs/src/net/sourceforge/squirrel_sql/plugins/favs/Folder.java
Method name: void createGUI() Method name: void setSubFolders(Folder[])
Number of AST nodes: 2 Number of AST nodes: 3
1
for (int pnlIdx = 0; pnlIdx
1
if (value != null) {
2
 < pnls.length; ++pnlIdx)
2
			for (int i = 0; i < value.length; ++
3
					{
4
						_panels.add(pnls[pnlIdx
3
i) {
5
]);
4
				_subFolders.add(value[i]);
6
			
5
			}
7
		}
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.3
Clones locationClones are in different classes
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    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)
    3
    for (int i = 0; i < value.length; ++i)
    Differences
    Expression1Expression2Difference
    pnlIdxiVARIABLE_NAME_MISMATCH
    pnlIdxiVARIABLE_NAME_MISMATCH
    pnlsvalueVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.client.preferences.IGlobalPreferencesPanel[]net.sourceforge.squirrel_sql.plugins.favs.Folder[]VARIABLE_TYPE_MISMATCH
    pnlIdxiVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type int of variable pnls.length does not match with type int of variable value.length
    • Make classes net.sourceforge.squirrel_sql.client.preferences.IGlobalPreferencesPanel[] and net.sourceforge.squirrel_sql.plugins.favs.Folder[] extend a common superclass
    3
    for (int i = 0; i < value.length; ++i)
    15
    _panels.add(pnls[pnlIdx]);
    15
    _panels.add(pnls[pnlIdx]);
    4
    _subFolders.add(value[i]);
    Differences
    Expression1Expression2Difference
    pnlsvalueVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.client.preferences.IGlobalPreferencesPanel[]net.sourceforge.squirrel_sql.plugins.favs.Folder[]VARIABLE_TYPE_MISMATCH
    pnlIdxiVARIABLE_NAME_MISMATCH
    _panels_subFoldersVARIABLE_NAME_MISMATCH
    java.util.Listjava.util.ListVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.client.preferences.IGlobalPreferencesPanel[] of variable pnls does not match with type net.sourceforge.squirrel_sql.plugins.favs.Folder[] of variable value
    • Make classes net.sourceforge.squirrel_sql.client.preferences.IGlobalPreferencesPanel[] and net.sourceforge.squirrel_sql.plugins.favs.Folder[] extend a common superclass
    Type java.util.List<net.sourceforge.squirrel_sql.client.preferences.IGlobalPreferencesPanel> of variable _panels does not match with type java.util.List<net.sourceforge.squirrel_sql.plugins.favs.Folder> of variable _subFolders
    • Make classes java.util.List and java.util.List extend a common superclass
    4
    _subFolders.add(value[i]);
    Precondition Violations (4)
    Row Violation
    1Type int of variable pnls.length does not match with type int of variable value.length
    2Type net.sourceforge.squirrel_sql.client.preferences.IGlobalPreferencesPanel[] of variable pnls does not match with type net.sourceforge.squirrel_sql.plugins.favs.Folder[] of variable value
    3Type java.util.List<net.sourceforge.squirrel_sql.client.preferences.IGlobalPreferencesPanel> of variable _panels does not match with type java.util.List<net.sourceforge.squirrel_sql.plugins.favs.Folder> of variable _subFolders
    4The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.client.preferences.GlobalPreferencesSheet and net.sourceforge.squirrel_sql.plugins.favs.Folder do not have a common superclass