PluginInfo pi = plugins[plugIdx]; if (pi.isLoaded()) { INewSessionPropertiesPanel[] pnls = pi.getPlugin().getNewSessionPropertiesPanels(); if (pnls != null && pnls.length > 0) { for (int pnlIdx = 0; pnlIdx < pnls.length; ++pnlIdx) { _panels.add(pnls[pnlIdx]); } } }
PluginInfo pi = plugins[plugIdx]; if (pi.isLoaded()) { IGlobalPreferencesPanel[] pnls = pi.getPlugin().getGlobalPreferencePanels(); if (pnls != null && pnls.length > 0) { 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/preferences/NewSessionPropertiesSheet.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/preferences/GlobalPreferencesSheet.java
Method name: void createGUI() Method name: void createGUI()
Number of AST nodes: 6 Number of AST nodes: 6
1
PluginInfo pi = plugins[plugIdx];
1
PluginInfo pi = plugins[plugIdx];
2
			if (pi.isLoaded())
2
			if (pi.isLoaded())
3
			{
3
			{
4
				INewSessionPropertiesPanel[] pnls =
4
				IGlobalPreferencesPanel[] pnls =
5
					pi.getPlugin().getNewSessionPropertiesPanels();
5
 pi.getPlugin().getGlobalPreferencePanels();
6
				if (pnls != null && pnls.length > 0)
6
				if (pnls != null && pnls.length > 0)
7
				{
7
				{
8
					for (int pnlIdx = 0; pnlIdx < pnls.length; ++pnlIdx)
8
					for (int pnlIdx = 0; pnlIdx < pnls.length; ++pnlIdx)
9
					{
9
					{
10
						_panels.add(pnls[pnlIdx]);
10
						_panels.add(pnls[pnlIdx]);
11
					}
11
					}
12
				}
12
				}
13
			}
13
			}
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.6
Clones locationClones are in different classes having the same super class
Number of node comparisons12
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)3.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    8
    PluginInfo pi = plugins[plugIdx];
    10
    PluginInfo pi = plugins[plugIdx];
    9
    if (pi.isLoaded())
    11
    if (pi.isLoaded())
    10
    INewSessionPropertiesPanel[] pnls = pi.getPlugin().getNewSessionPropertiesPanels();
    10
    INewSessionPropertiesPanel[] pnls = pi.getPlugin().getNewSessionPropertiesPanels();
    Preondition Violations
    Unmatched statement INewSessionPropertiesPanel[] pnls=pi.getPlugin().getNewSessionPropertiesPanels(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                                              
                                                                                                                                                                
    12
    IGlobalPreferencesPanel[] pnls = pi.getPlugin().getGlobalPreferencePanels();
    Preondition Violations
    Unmatched statement IGlobalPreferencesPanel[] pnls=pi.getPlugin().getGlobalPreferencePanels(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    12
    IGlobalPreferencesPanel[] pnls = pi.getPlugin().getGlobalPreferencePanels();
    11
    if (pnls != null && pnls.length > 0)
    11
    if (pnls != null && pnls.length > 0)
    13
    if (pnls != null && pnls.length > 0)
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.client.preferences.INewSessionPropertiesPanel[]net.sourceforge.squirrel_sql.client.preferences.IGlobalPreferencesPanel[]VARIABLE_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.client.preferences.INewSessionPropertiesPanel[]net.sourceforge.squirrel_sql.client.preferences.IGlobalPreferencesPanel[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.client.preferences.INewSessionPropertiesPanel[] of variable pnls does not match with type net.sourceforge.squirrel_sql.client.preferences.IGlobalPreferencesPanel[] of variable pnls
    • Make classes net.sourceforge.squirrel_sql.client.preferences.INewSessionPropertiesPanel[] and net.sourceforge.squirrel_sql.client.preferences.IGlobalPreferencesPanel[] extend a common superclass
    Type int of variable pnls.length does not match with type int of variable pnls.length
    • Make classes net.sourceforge.squirrel_sql.client.preferences.INewSessionPropertiesPanel[] and net.sourceforge.squirrel_sql.client.preferences.IGlobalPreferencesPanel[] extend a common superclass
    13
    if (pnls != null && pnls.length > 0)
    12
    for (int pnlIdx = 0; pnlIdx < pnls.length; ++pnlIdx)
    12
    for (int pnlIdx = 0; pnlIdx < pnls.length; ++pnlIdx)
    14
    for (int pnlIdx = 0; pnlIdx < pnls.length; ++pnlIdx)
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.client.preferences.INewSessionPropertiesPanel[]net.sourceforge.squirrel_sql.client.preferences.IGlobalPreferencesPanel[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable pnls.length does not match with type int of variable pnls.length
    • Make classes net.sourceforge.squirrel_sql.client.preferences.INewSessionPropertiesPanel[] and net.sourceforge.squirrel_sql.client.preferences.IGlobalPreferencesPanel[] extend a common superclass
    14
    for (int pnlIdx = 0; pnlIdx < pnls.length; ++pnlIdx)
    13
    _panels.add(pnls[pnlIdx]);
    13
    _panels.add(pnls[pnlIdx]);
    15
    _panels.add(pnls[pnlIdx]);
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.client.preferences.INewSessionPropertiesPanel[]net.sourceforge.squirrel_sql.client.preferences.IGlobalPreferencesPanel[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.client.preferences.INewSessionPropertiesPanel[] of variable pnls does not match with type net.sourceforge.squirrel_sql.client.preferences.IGlobalPreferencesPanel[] of variable pnls
    • Make classes net.sourceforge.squirrel_sql.client.preferences.INewSessionPropertiesPanel[] and net.sourceforge.squirrel_sql.client.preferences.IGlobalPreferencesPanel[] extend a common superclass
    15
    _panels.add(pnls[pnlIdx]);
    Precondition Violations (6)
    Row Violation
    1Unmatched statement INewSessionPropertiesPanel[] pnls=pi.getPlugin().getNewSessionPropertiesPanels(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement IGlobalPreferencesPanel[] pnls=pi.getPlugin().getGlobalPreferencePanels(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Type net.sourceforge.squirrel_sql.client.preferences.INewSessionPropertiesPanel[] of variable pnls does not match with type net.sourceforge.squirrel_sql.client.preferences.IGlobalPreferencesPanel[] of variable pnls
    4Type int of variable pnls.length does not match with type int of variable pnls.length
    5Type int of variable pnls.length does not match with type int of variable pnls.length
    6Type net.sourceforge.squirrel_sql.client.preferences.INewSessionPropertiesPanel[] of variable pnls does not match with type net.sourceforge.squirrel_sql.client.preferences.IGlobalPreferencesPanel[] of variable pnls