super.removeNotify(); if (_timer != null) { _timer.stop(); _timer = null; }
super.removeNotify(); if (_propsListener != null) { _session.getProperties().removePropertyChangeListener(_propsListener); _propsListener = null; }
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/gui/TimePanel.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/ResultTab.java
Method name: void removeNotify() Method name: void removeNotify()
Number of AST nodes: 4 Number of AST nodes: 4
1
super.removeNotify();
1
super.removeNotify();
2
		if (_timer != null)
2
		if (_propsListener != null)
3
		{
3
		{
4
			_timer.stop();
4
			_
5
			_tim
5
session.getProperties().removePropertyChangeListener(_propsListener);
6
er = null;
6
			_propsListener = null;
7
		}
7
		}
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 having the same super class
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)23.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    super.removeNotify();
    1
    super.removeNotify();
    1
    super.removeNotify();
    Preondition Violations
    Super method call super.removeNotify(); cannot be extracted from method
    Super method call super.removeNotify(); cannot be extracted from method
    1
    super.removeNotify();
    2
    if (_timer != null)
    2
    if (_timer != null)
    2
    if (_propsListener != null)
    Differences
    Expression1Expression2Difference
    _timer_propsListenerVARIABLE_NAME_MISMATCH
    javax.swing.Timerjava.beans.PropertyChangeListenerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type javax.swing.Timer of variable _timer does not match with type java.beans.PropertyChangeListener of variable _propsListener
    • Make classes javax.swing.Timer and java.beans.PropertyChangeListener extend a common superclass
    2
    if (_propsListener != null)
                                                                                                                                                      
    3
    _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
    _session.getProperties().removePropertyChangeListener(_propsListener);
    3
    _timer.stop();
    3
    _timer.stop();
    Preondition Violations
    Unmatched statement _timer.stop(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                      
                                                  
    4
    _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
    _propsListener = null;
    4
    _timer = null;
    4
    _timer = null;
    Preondition Violations
    Unmatched statement _timer=null; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                  
    Precondition Violations (8)
    Row Violation
    1Super method call super.removeNotify(); cannot be extracted from method
    2Super method call super.removeNotify(); cannot be extracted from method
    3Type javax.swing.Timer of variable _timer does not match with type java.beans.PropertyChangeListener of variable _propsListener
    4Unmatched statement _session.getProperties().removePropertyChangeListener(_propsListener); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched statement _timer.stop(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched statement _propsListener=null; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7Unmatched statement _timer=null; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    8The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.fw.gui.TimePanel and net.sourceforge.squirrel_sql.client.session.mainpanel.ResultTab do not have a common superclass