if (_cache != null) { _cache.save(); } super.unload();
if (_tab != null) { _tab.closeTab(); _tab = null; } super.dispose();
Clone fragments detected by clone detection tool
File path: /sql12/plugins/sessionscript/src/net/sourceforge/squirrel_sql/plugins/sessionscript/SessionScriptPlugin.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/ResultFrame.java
Method name: void unload() Method name: void dispose()
Number of AST nodes: 3 Number of AST nodes: 4
1
if (_cache != null)
1
if (_tab != null)
2
		{
2
		{
3
			_cache.save()
3
			_tab.closeTab();
4
;
4
			_tab = null;
5
		}
5
		}
6
		super.unload();
6
		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 comparisons7
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.8
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (_cache != null)
    1
    if (_cache != null)
    1
    if (_tab != null)
    Differences
    Expression1Expression2Difference
    _cache_tabVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.plugins.sessionscript.AliasScriptCachenet.sourceforge.squirrel_sql.client.session.mainpanel.IResultTabVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.plugins.sessionscript.AliasScriptCache of variable _cache does not match with type net.sourceforge.squirrel_sql.client.session.mainpanel.IResultTab of variable _tab
    • Make classes net.sourceforge.squirrel_sql.plugins.sessionscript.AliasScriptCache 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
    _cache.save();
    2
    _cache.save();
    Preondition Violations
    Unmatched statement _cache.save(); 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;
    3
    super.unload();
    3
    super.unload();
    4
    super.dispose();
    Differences
    Expression1Expression2Difference
    unloaddisposeMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression super.unload() is a void method call, and thus it cannot be parameterized
    Expression super.dispose() is a void method call, and thus it cannot be parameterized
    Super method call super.unload(); cannot be extracted from method
    Super method call super.dispose(); cannot be extracted from method
    4
    super.dispose();
    Precondition Violations (10)
    Row Violation
    1Type net.sourceforge.squirrel_sql.plugins.sessionscript.AliasScriptCache of variable _cache 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 _cache.save(); 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
    6Expression super.unload() is a void method call, and thus it cannot be parameterized
    7Expression super.dispose() is a void method call, and thus it cannot be parameterized
    8Super method call super.unload(); cannot be extracted from method
    9Super method call super.dispose(); cannot be extracted from method
    10The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.plugins.sessionscript.SessionScriptPlugin and net.sourceforge.squirrel_sql.client.session.mainpanel.ResultFrame do not have a common superclass