if (pi == null) { throw new IllegalArgumentException("Null PluginInfo passed"); } return pi.getPluginClassName();
if (dbinfo == null) { throw new IllegalArgumentException("IDatabaseObjectInfo == null"); } return dbinfo.toString();
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/plugin/SessionPluginInfo.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/ObjectTreeNode.java
Method name: String getPassedPluginClassName(PluginInfo) Method name: String getNodeTitle(IDatabaseObjectInfo)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (pi == null)
1
if (dbinfo == null)
2
		{
2
		{
3
			throw new IllegalArgumentException("Null PluginInfo passed");
3
			throw new IllegalArgumentException("
4
		}
5
		return pi.getPluginClassName
4
IDatabaseObjectInfo == null");
5
		}
6
();
6
		return dbinfo.toString();
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 comparisons5
  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 fragment1
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (pi == null)
    1
    if (pi == null)
    1
    if (dbinfo == null)
    Differences
    Expression1Expression2Difference
    pidbinfoVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.client.plugin.PluginInfonet.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfoVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.client.plugin.PluginInfo of variable pi does not match with type net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo of variable dbinfo
    • Make classes net.sourceforge.squirrel_sql.client.plugin.PluginInfo and net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo extend a common superclass
    1
    if (dbinfo == null)
    2
    throw new IllegalArgumentException("Null PluginInfo passed");
    2
    throw new IllegalArgumentException("Null PluginInfo passed");
    2
    throw new IllegalArgumentException("IDatabaseObjectInfo == null");
    Differences
    Expression1Expression2Difference
    "Null PluginInfo passed""IDatabaseObjectInfo == null"LITERAL_VALUE_MISMATCH
    2
    throw new IllegalArgumentException("IDatabaseObjectInfo == null");
                                                            
    3
    return dbinfo.toString();
    Preondition Violations
    Unmatched statement return dbinfo.toString(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return dbinfo.toString();
    3
    return dbinfo.toString();
    3
    return pi.getPluginClassName();
    3
    return pi.getPluginClassName();
    Preondition Violations
    Unmatched statement return pi.getPluginClassName(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return pi.getPluginClassName();
                                                                        
    Precondition Violations (6)
    Row Violation
    1Type net.sourceforge.squirrel_sql.client.plugin.PluginInfo of variable pi does not match with type net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo of variable dbinfo
    2Unmatched statement return dbinfo.toString(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched return dbinfo.toString();
    4Unmatched statement return pi.getPluginClassName(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched return pi.getPluginClassName();
    6The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.client.plugin.SessionPluginInfo and net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTreeNode do not have a common superclass