if (app == null) { throw new IllegalArgumentException("Null IApplication passed"); } if (session == null) { throw new IllegalArgumentException("Null ISession passed"); } _props = session.getProperties(); _myPanel.loadData(_props);
if (app == null) { throw new IllegalArgumentException("Null IApplication passed"); } if (session == null) { throw new IllegalArgumentException("Null ISession passed"); } _myPanel.loadData(_prefs);
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/properties/GeneralSessionPropertiesPanel.java File path: /sql12/plugins/syntax/src/net/sourceforge/squirrel_sql/plugins/syntax/SyntaxPreferencesPanel.java
Method name: void initialize(IApplication, ISession) Method name: void initialize(IApplication, ISession)
Number of AST nodes: 6 Number of AST nodes: 5
1
if (app == null)
1
if (app == null)
2
		{
2
		{
3
			throw new IllegalArgumentException("Null IApplication passed");
3
			throw new IllegalArgumentException("Null IApplication passed");
4
		}
4
		}
5
		if (session == null)
5
		if (session == null)
6
		{
6
		{
7
			throw new IllegalArgumentException("Null ISession passed");
7
			throw new IllegalArgumentException("Null ISession passed");
8
		}
8
		}
9
		_props = session.getProperties();
10
		_myPanel.loadData(_props);
9
		_myPanel.loadData(_prefs);
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 comparisons15
  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 fragment0
    Time elapsed for statement mapping (ms)15.7
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (app == null)
    1
    if (app == null)
    2
    throw new IllegalArgumentException("Null IApplication passed");
    2
    throw new IllegalArgumentException("Null IApplication passed");
    3
    if (session == null)
    3
    if (session == null)
    4
    throw new IllegalArgumentException("Null ISession passed");
    4
    throw new IllegalArgumentException("Null ISession passed");
    5
    _props = session.getProperties();
    5
    _props = session.getProperties();
    Preondition Violations
    Unmatched statement _props=session.getProperties(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                        
    6
    _myPanel.loadData(_props);
    6
    _myPanel.loadData(_props);
    5
    _myPanel.loadData(_prefs);
    Differences
    Expression1Expression2Difference
    _props_prefsVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.client.session.properties.SessionPropertiesnet.sourceforge.squirrel_sql.plugins.syntax.SyntaxPreferencesVARIABLE_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.client.session.properties.GeneralSessionPropertiesPanel.MyPanelnet.sourceforge.squirrel_sql.plugins.syntax.SyntaxPreferencesPanel.MyPanelSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.client.session.properties.SessionProperties of variable _props does not match with type net.sourceforge.squirrel_sql.plugins.syntax.SyntaxPreferences of variable _prefs
    • Make classes net.sourceforge.squirrel_sql.client.session.properties.SessionProperties and net.sourceforge.squirrel_sql.plugins.syntax.SyntaxPreferences extend a common superclass
    Expression _myPanel cannot be unified with expression _myPanel , because common superclass javax.swing.JPanel does not declare member(s) void loadData(net.sourceforge.squirrel_sql.client.session.properties.SessionProperties) , void loadData(net.sourceforge.squirrel_sql.plugins.syntax.SyntaxPreferences)
    5
    _myPanel.loadData(_prefs);
    Precondition Violations (3)
    Row Violation
    1Unmatched statement _props=session.getProperties(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Type net.sourceforge.squirrel_sql.client.session.properties.SessionProperties of variable _props does not match with type net.sourceforge.squirrel_sql.plugins.syntax.SyntaxPreferences of variable _prefs
    3Expression _myPanel cannot be unified with expression _myPanel , because common superclass javax.swing.JPanel does not declare member(s) void loadData(net.sourceforge.squirrel_sql.client.session.properties.SessionProperties) , void loadData(net.sourceforge.squirrel_sql.plugins.syntax.SyntaxPreferences)