if (_propsListener != null) { _session.getProperties().removePropertyChangeListener(_propsListener); _propsListener = null; }
if (conn != null) { closeConnection(conn); conn = null; }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/SQLPanel.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/mainframe/action/ConnectToAliasCommand.java
Method name: void sessionClosing() Method name: void run()
Number of AST nodes: 3 Number of AST nodes: 3
1
if (_propsListener != null)
1
if (conn != null)
2
		{
2
						{
3
			_session.getProperties().removePropertyChangeListener(_propsListener);
3
			
4
			_propsListener
4
				closeConnection(conn);
5
 = null;
5
							conn = null;
6
		}
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.1
Clones locationClones are in different classes
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)11.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (_propsListener != null)
    1
    if (_propsListener != null)
    13
    if (conn != null)
    Differences
    Expression1Expression2Difference
    _propsListenerconnVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.client.session.mainpanel.SQLPanel.MyPropertiesListenernet.sourceforge.squirrel_sql.fw.sql.SQLConnectionVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.client.session.mainpanel.SQLPanel.MyPropertiesListener of variable _propsListener does not match with type net.sourceforge.squirrel_sql.fw.sql.SQLConnection of variable conn
    • Make classes net.sourceforge.squirrel_sql.client.session.mainpanel.SQLPanel.MyPropertiesListener and net.sourceforge.squirrel_sql.fw.sql.SQLConnection extend a common superclass
    13
    if (conn != null)
    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
    _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
                                                  
                                                        
    14
    closeConnection(conn);
    Preondition Violations
    Unmatched statement closeConnection(conn); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    14
    closeConnection(conn);
                                
    15
    conn = null;
    Preondition Violations
    Unmatched statement conn=null; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    15
    conn = null;
    Precondition Violations (6)
    Row Violation
    1Type net.sourceforge.squirrel_sql.client.session.mainpanel.SQLPanel.MyPropertiesListener of variable _propsListener does not match with type net.sourceforge.squirrel_sql.fw.sql.SQLConnection of variable conn
    2Unmatched statement _session.getProperties().removePropertyChangeListener(_propsListener); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement _propsListener=null; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement closeConnection(conn); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched statement conn=null; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero