if (conn != null) { closeConnection(conn); conn = null; }
if (_toolBar != null) { remove(_toolBar); _toolBar = null; }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/mainframe/action/ConnectToAliasCommand.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/session/SessionPanel.java
Method name: void run() Method name: void propertiesHaveChanged(String)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (conn != null)
1
if (_toolBar != null)
2
						{
2
						{
3
							closeConnection(conn);
3
							remove(_toolBar);
4
							conn = null;
4
							_toolBar = null;
5
						}
5
						}
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 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)1.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    13
    if (conn != null)
    13
    if (conn != null)
    18
    if (_toolBar != null)
    Differences
    Expression1Expression2Difference
    conn_toolBarVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.fw.sql.SQLConnectionnet.sourceforge.squirrel_sql.client.gui.session.SessionPanel.MyToolBarVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.fw.sql.SQLConnection of variable conn does not match with type net.sourceforge.squirrel_sql.client.gui.session.SessionPanel.MyToolBar of variable _toolBar
    • Make classes net.sourceforge.squirrel_sql.fw.sql.SQLConnection and net.sourceforge.squirrel_sql.client.gui.session.SessionPanel.MyToolBar extend a common superclass
    18
    if (_toolBar != null)
    14
    closeConnection(conn);
    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
                                                        
    15
    conn = null;
    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
                                
                                              
    19
    remove(_toolBar);
    Preondition Violations
    Unmatched statement remove(_toolBar); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    19
    remove(_toolBar);
                                        
    20
    _toolBar = null;
    Preondition Violations
    Unmatched statement _toolBar=null; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    20
    _toolBar = null;
    Precondition Violations (6)
    Row Violation
    1Type net.sourceforge.squirrel_sql.fw.sql.SQLConnection of variable conn does not match with type net.sourceforge.squirrel_sql.client.gui.session.SessionPanel.MyToolBar of variable _toolBar
    2Unmatched statement closeConnection(conn); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement conn=null; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement remove(_toolBar); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched statement _toolBar=null; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero