for (int i = 0; i < objTypes.length; ++i) { objTypesList.add(objTypes[i]); }
for (int pnlIdx = 0; pnlIdx < pnls.length; ++pnlIdx) { _panels.add(pnls[pnlIdx]); }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/plugin/PluginManager.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/properties/SessionPropertiesSheet.java
Method name: IPluginDatabaseObjectType[] getDatabaseObjectTypes(ISession) Method name: void createGUI()
Number of AST nodes: 2 Number of AST nodes: 2
1
for (int i = 0; i < objTypes.length; ++i)
1
for (int pnlIdx = 0; pnlIdx < pnls.length; ++pnlIdx)
2
					{
2
					{
3
						objTypesList.add(objTypes[i]);
3
						_panels.add(pnls[pnlIdx]);
4
					}
4
					}
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 comparisons7
  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)3.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    8
    for (int i = 0; i < objTypes.length; ++i)
    8
    for (int i = 0; i < objTypes.length; ++i)
    13
    for (int pnlIdx = 0; pnlIdx < pnls.length; ++pnlIdx)
    Differences
    Expression1Expression2Difference
    ipnlIdxVARIABLE_NAME_MISMATCH
    ipnlIdxVARIABLE_NAME_MISMATCH
    objTypespnlsVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.client.plugin.IPluginDatabaseObjectType[]net.sourceforge.squirrel_sql.client.session.properties.ISessionPropertiesPanel[]VARIABLE_TYPE_MISMATCH
    ipnlIdxVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type int of variable objTypes.length does not match with type int of variable pnls.length
    • Make classes net.sourceforge.squirrel_sql.client.plugin.IPluginDatabaseObjectType[] and net.sourceforge.squirrel_sql.client.session.properties.ISessionPropertiesPanel[] extend a common superclass
    13
    for (int pnlIdx = 0; pnlIdx < pnls.length; ++pnlIdx)
    9
    objTypesList.add(objTypes[i]);
    9
    objTypesList.add(objTypes[i]);
    14
    _panels.add(pnls[pnlIdx]);
    Differences
    Expression1Expression2Difference
    objTypespnlsVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.client.plugin.IPluginDatabaseObjectType[]net.sourceforge.squirrel_sql.client.session.properties.ISessionPropertiesPanel[]VARIABLE_TYPE_MISMATCH
    ipnlIdxVARIABLE_NAME_MISMATCH
    objTypesList_panelsVARIABLE_NAME_MISMATCH
    java.util.Listjava.util.ListVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.client.plugin.IPluginDatabaseObjectType[] of variable objTypes does not match with type net.sourceforge.squirrel_sql.client.session.properties.ISessionPropertiesPanel[] of variable pnls
    • Make classes net.sourceforge.squirrel_sql.client.plugin.IPluginDatabaseObjectType[] and net.sourceforge.squirrel_sql.client.session.properties.ISessionPropertiesPanel[] extend a common superclass
    Type java.util.List<net.sourceforge.squirrel_sql.client.plugin.IPluginDatabaseObjectType> of variable objTypesList does not match with type java.util.List<net.sourceforge.squirrel_sql.client.session.properties.ISessionPropertiesPanel> of variable _panels
    • Make classes java.util.List and java.util.List extend a common superclass
    14
    _panels.add(pnls[pnlIdx]);
    Precondition Violations (4)
    Row Violation
    1Type int of variable objTypes.length does not match with type int of variable pnls.length
    2Type net.sourceforge.squirrel_sql.client.plugin.IPluginDatabaseObjectType[] of variable objTypes does not match with type net.sourceforge.squirrel_sql.client.session.properties.ISessionPropertiesPanel[] of variable pnls
    3Type java.util.List<net.sourceforge.squirrel_sql.client.plugin.IPluginDatabaseObjectType> of variable objTypesList does not match with type java.util.List<net.sourceforge.squirrel_sql.client.session.properties.ISessionPropertiesPanel> of variable _panels
    4The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.client.plugin.PluginManager and net.sourceforge.squirrel_sql.client.session.properties.SessionPropertiesSheet do not have a common superclass