if (prefsPanel != null) { prefsPanel.applyChanges(); }
if (_tab != null) { _tab.closeTab(); _tab = null; } super.dispose();
Clone fragments detected by clone detection tool
File path: /sql12/plugins/refactoring/src/net/sourceforge/squirrel_sql/plugins/refactoring/prefs/RefactoringPreferencesTab.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/ResultFrame.java
Method name: void applyChanges() Method name: void dispose()
Number of AST nodes: 2 Number of AST nodes: 4
1
if (prefsPanel != null) {
1
if (
2
            prefsPanel.applyChanges();
3
        }
2
_tab != null)
3
		{
4
			_tab.closeTab();
5
			_tab = null;
6
		}
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.1
Clones locationClones are in different classes
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (prefsPanel != null)
    1
    if (prefsPanel != null)
    1
    if (_tab != null)
    Differences
    Expression1Expression2Difference
    prefsPanel_tabVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.plugins.refactoring.prefs.RefactoringPreferencesPanelnet.sourceforge.squirrel_sql.client.session.mainpanel.IResultTabVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.plugins.refactoring.prefs.RefactoringPreferencesPanel of variable prefsPanel does not match with type net.sourceforge.squirrel_sql.client.session.mainpanel.IResultTab of variable _tab
    • Make classes net.sourceforge.squirrel_sql.plugins.refactoring.prefs.RefactoringPreferencesPanel and net.sourceforge.squirrel_sql.client.session.mainpanel.IResultTab extend a common superclass
    1
    if (_tab != null)
                                          
    2
    _tab.closeTab();
    Preondition Violations
    Unmatched statement _tab.closeTab(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement _tab.closeTab(); 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
    2
    _tab.closeTab();
    2
    prefsPanel.applyChanges();
    2
    prefsPanel.applyChanges();
    Preondition Violations
    Unmatched statement prefsPanel.applyChanges(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                              
                              
    3
    _tab = null;
    Preondition Violations
    Unmatched statement _tab=null; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3
    _tab = null;
                                          
    4
    super.dispose();
    Precondition Violations (6)
    Row Violation
    1Type net.sourceforge.squirrel_sql.plugins.refactoring.prefs.RefactoringPreferencesPanel of variable prefsPanel does not match with type net.sourceforge.squirrel_sql.client.session.mainpanel.IResultTab of variable _tab
    2Unmatched statement _tab.closeTab(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement _tab.closeTab(); 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
    4Unmatched statement prefsPanel.applyChanges(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched statement _tab=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