if (_propsListener != null) { _session.getProperties().removePropertyChangeListener( _propsListener); _propsListener = null; } closeAllSQLResultFrames();
if (_driversCacheLis != null) { _app.getDataCache().removeDriversListener(_driversCacheLis); _driversCacheLis = null; } super.dispose();
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/SQLResultExecuterPanel.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/db/AliasInternalFrame.java
Method name: void sessionClosing() Method name: void dispose()
Number of AST nodes: 4 Number of AST nodes: 4
1
if (_propsListener != null)
1
if (_driversCacheLis != null)
2
		{
2
		{
3
			_session.getProperties().removePropertyChangeListener(
3
			_
4
					_propsListener);
5
			_propsListener
4
app.getDataCache().removeDriversListener(_driversCacheLis);
6
 = null;
5
			_driversCacheLis = null;
7
		}
6
		}
8
		closeAllSQLResultFrames();
7
		super.dispose();
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.2
Clones locationClones are in different classes
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)27.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (_propsListener != null)
    1
    if (_propsListener != null)
    1
    if (_driversCacheLis != null)
    Differences
    Expression1Expression2Difference
    _propsListener_driversCacheLisVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.client.session.mainpanel.SQLResultExecuterPanel.MyPropertiesListenernet.sourceforge.squirrel_sql.client.gui.db.AliasInternalFrame.DriversCacheListenerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.client.session.mainpanel.SQLResultExecuterPanel.MyPropertiesListener of variable _propsListener does not match with type net.sourceforge.squirrel_sql.client.gui.db.AliasInternalFrame.DriversCacheListener of variable _driversCacheLis
    • Make classes net.sourceforge.squirrel_sql.client.session.mainpanel.SQLResultExecuterPanel.MyPropertiesListener and net.sourceforge.squirrel_sql.client.gui.db.AliasInternalFrame.DriversCacheListener extend a common superclass
    1
    if (_driversCacheLis != null)
                                                                                                                                  
    2
    _app.getDataCache().removeDriversListener(_driversCacheLis);
    Preondition Violations
    Unmatched statement _app.getDataCache().removeDriversListener(_driversCacheLis); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2
    _app.getDataCache().removeDriversListener(_driversCacheLis);
    2
    _session.getProperties().removePropertyChangeListener(_propsListener);
    2
    _session.getProperties().removePropertyChangeListener(_propsListener);
    Preondition Violations
    Unmatched statement _session.getProperties().removePropertyChangeListener(_propsListener); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                      
                                                      
    3
    _driversCacheLis = null;
    Preondition Violations
    Unmatched statement _driversCacheLis=null; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3
    _driversCacheLis = null;
    3
    _propsListener = null;
    3
    _propsListener = null;
    Preondition Violations
    Unmatched statement _propsListener=null; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                  
    4
    closeAllSQLResultFrames();
    4
    closeAllSQLResultFrames();
    4
    super.dispose();
    Differences
    Expression1Expression2Difference
    closeAllSQLResultFrames()super.dispose()TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression closeAllSQLResultFrames() is a void method call, and thus it cannot be parameterized
    Expression super.dispose() is a void method call, and thus it cannot be parameterized
    Super method call super.dispose(); cannot be extracted from method
    4
    super.dispose();
    Precondition Violations (9)
    Row Violation
    1Type net.sourceforge.squirrel_sql.client.session.mainpanel.SQLResultExecuterPanel.MyPropertiesListener of variable _propsListener does not match with type net.sourceforge.squirrel_sql.client.gui.db.AliasInternalFrame.DriversCacheListener of variable _driversCacheLis
    2Unmatched statement _app.getDataCache().removeDriversListener(_driversCacheLis); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement _session.getProperties().removePropertyChangeListener(_propsListener); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement _driversCacheLis=null; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched statement _propsListener=null; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Expression closeAllSQLResultFrames() is a void method call, and thus it cannot be parameterized
    7Expression super.dispose() is a void method call, and thus it cannot be parameterized
    8Super method call super.dispose(); cannot be extracted from method
    9The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.client.session.mainpanel.SQLResultExecuterPanel and net.sourceforge.squirrel_sql.client.gui.db.AliasInternalFrame do not have a common superclass