try { final AliasGroup obj = (AliasGroup)super.clone(); obj._propChgReporter = null; return obj; } catch (CloneNotSupportedException ex) { throw new InternalError(ex.getMessage()); // Impossible. }
try { SyntaxPreferences prefs = (SyntaxPreferences)super.clone(); prefs._propChgReporter = null; return prefs; } catch (CloneNotSupportedException ex) { throw new InternalError(ex.getMessage()); // Impossible. }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/db/AliasGroup.java File path: /sql12/plugins/syntax/src/net/sourceforge/squirrel_sql/plugins/syntax/SyntaxPreferences.java
Method name: Object clone() Method name: Object clone()
Number of AST nodes: 4 Number of AST nodes: 4
1
try
1
try
2
		{
2
		{
3
			final AliasGroup obj = (AliasGroup)super.clone();
3
			SyntaxPreferences prefs = (SyntaxPreferences)super.clone();
4
			obj._propChgReporter = null;
4
			prefs._propChgReporter = null;
5
			return obj;
5
			return prefs;
6
		}
6
		}
7
		catch (CloneNotSupportedException ex)
7
		catch (CloneNotSupportedException ex)
8
		{
8
		{
9
			throw new InternalError(ex.getMessage()); // Impossible.
9
			throw new InternalError(ex.getMessage()); // Impossible.
10
		}
10
		}
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 comparisons16
  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)1.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    try
    1
    try
                                                                                                                            
    2
    SyntaxPreferences prefs = (SyntaxPreferences)super.clone();
    Preondition Violations
    Unmatched statement SyntaxPreferences prefs=(SyntaxPreferences)super.clone(); 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
    SyntaxPreferences prefs = (SyntaxPreferences)super.clone();
    2
    final AliasGroup obj = (AliasGroup)super.clone();
    2
    final AliasGroup obj = (AliasGroup)super.clone();
    Preondition Violations
    Unmatched statement final AliasGroup obj=(AliasGroup)super.clone(); 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
                                                                                                        
    3
    obj._propChgReporter = null;
    3
    obj._propChgReporter = null;
    3
    prefs._propChgReporter = null;
    Differences
    Expression1Expression2Difference
    objprefsVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.client.db.AliasGroupnet.sourceforge.squirrel_sql.plugins.syntax.SyntaxPreferencesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression obj._propChgReporter cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression prefs._propChgReporter cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type net.sourceforge.squirrel_sql.fw.util.PropertyChangeReporter of variable obj._propChgReporter does not match with type net.sourceforge.squirrel_sql.fw.util.PropertyChangeReporter of variable prefs._propChgReporter
    • Make classes net.sourceforge.squirrel_sql.client.db.AliasGroup and net.sourceforge.squirrel_sql.plugins.syntax.SyntaxPreferences extend a common superclass
    3
    prefs._propChgReporter = null;
                                    
    4
    return prefs;
    4
    return obj;
                                
    Precondition Violations (5)
    Row Violation
    1Unmatched statement SyntaxPreferences prefs=(SyntaxPreferences)super.clone(); 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
    2Unmatched statement final AliasGroup obj=(AliasGroup)super.clone(); 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
    3Expression obj._propChgReporter cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression prefs._propChgReporter cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Type net.sourceforge.squirrel_sql.fw.util.PropertyChangeReporter of variable obj._propChgReporter does not match with type net.sourceforge.squirrel_sql.fw.util.PropertyChangeReporter of variable prefs._propChgReporter