if (_sessionSheet != null) { _sessionSheet.addToStatusBar(comp); } else { _statusBarToBeAdded.add(comp); }
if (_wrapee != null) { _wrapee.printStackTrace(wtr); } else { super.printStackTrace(wtr); }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/Session.java File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/util/BaseRuntimeException.java
Method name: void addToStatusBar(JComponent) Method name: void printStackTrace(PrintWriter)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (_sessionSheet != null)
1
if (_wrapee != null)
2
      {
3
         _sessionSheet.addToStatusBar(comp);
4
      }
5
      else
6
      {
7
         _statusBarToBeAdded.add(comp);
8
      
2
		{
3
			_wrapee.printStackTrace(wtr);
4
		}
5
		else
6
		{
7
			super.printStackTrace(wtr);
9
}
8
		}
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.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (_sessionSheet != null)
    1
    if (_sessionSheet != null)
    1
    if (_wrapee != null)
    Differences
    Expression1Expression2Difference
    _sessionSheet_wrapeeVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.client.gui.session.SessionPaneljava.lang.ThrowableVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.client.gui.session.SessionPanel of variable _sessionSheet does not match with type java.lang.Throwable of variable _wrapee
    • Make classes net.sourceforge.squirrel_sql.client.gui.session.SessionPanel and java.lang.Throwable extend a common superclass
    1
    if (_wrapee != null)
                                                                    
    2
    _wrapee.printStackTrace(wtr);
    Preondition Violations
    Unmatched statement _wrapee.printStackTrace(wtr); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2
    _wrapee.printStackTrace(wtr);
    2
    _sessionSheet.addToStatusBar(comp);
    2
    _sessionSheet.addToStatusBar(comp);
    Preondition Violations
    Unmatched statement _sessionSheet.addToStatusBar(comp); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement _sessionSheet.addToStatusBar(comp); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                                
    else
            
                                                                
    3
    super.printStackTrace(wtr);
    3
    _statusBarToBeAdded.add(comp);
                                                                      
    Precondition Violations (5)
    Row Violation
    1Type net.sourceforge.squirrel_sql.client.gui.session.SessionPanel of variable _sessionSheet does not match with type java.lang.Throwable of variable _wrapee
    2Unmatched statement _wrapee.printStackTrace(wtr); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement _sessionSheet.addToStatusBar(comp); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement _sessionSheet.addToStatusBar(comp); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    5The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero