String tip = null; final int idx = getList().locationToIndex(evt.getPoint()); if (idx != -1) { tip = ((ISQLDriver)getList().getModel().getElementAt(idx)).getName(); } else { tip = getToolTipText(); } return tip;
String tip; final int idx = getList().locationToIndex(evt.getPoint()); if (idx != -1) { tip = ((ISQLAlias)getList().getModel().getElementAt(idx)).getName(); } else { tip = getToolTipText(); } return tip;
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/db/DriversList.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/db/JListAliasesListImpl.java
Method name: String getToolTipText(MouseEvent) Method name: String getToolTipText(MouseEvent)
Number of AST nodes: 6 Number of AST nodes: 6
1
String tip = null;
1
String tip;
2
		final int idx = getList().locationToIndex(evt.getPoint());
2
		final int idx = getList().locationToIndex(evt.getPoint());
3
		if (idx != -1)
3
		if (idx != -1)
4
		{
4
		{
5
			tip = ((ISQLDriver)getList().getModel().getElementAt(idx)).getName();
5
			tip = ((ISQLAlias)getList().getModel().getElementAt(idx)).getName();
6
		}
6
		}
7
		else
7
		else
8
		{
8
		{
9
			tip = getToolTipText();
9
			tip = getToolTipText();
10
		}
10
		}
11
		return tip;
11
		return tip;
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 comparisons18
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)108.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                
    1
    String tip;
    1
    String tip = null;
                                          
    2
    final int idx = getList().locationToIndex(evt.getPoint());
    2
    final int idx = getList().locationToIndex(evt.getPoint());
    3
    if (idx != -1)
    3
    if (idx != -1)
    4
    tip = ((ISQLDriver)getList().getModel().getElementAt(idx)).getName();
    4
    tip = ((ISQLDriver)getList().getModel().getElementAt(idx)).getName();
    4
    tip = ((ISQLAlias)getList().getModel().getElementAt(idx)).getName();
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.fw.sql.ISQLDrivernet.sourceforge.squirrel_sql.fw.sql.ISQLAliasSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression (ISQLDriver)getList().getModel().getElementAt(idx) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (ISQLAlias)getList().getModel().getElementAt(idx) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (ISQLDriver)getList().getModel().getElementAt(idx) cannot be unified with expression (ISQLAlias)getList().getModel().getElementAt(idx) , because common superclass net.sourceforge.squirrel_sql.fw.id.IHasIdentifier does not declare member(s) public abstract java.lang.String getName()
    4
    tip = ((ISQLAlias)getList().getModel().getElementAt(idx)).getName();
    else
    else
    5
    tip = getToolTipText();
    5
    tip = getToolTipText();
    6
    return tip;
    6
    return tip;
    Precondition Violations (3)
    Row Violation
    1Expression (ISQLDriver)getList().getModel().getElementAt(idx) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression (ISQLAlias)getList().getModel().getElementAt(idx) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression (ISQLDriver)getList().getModel().getElementAt(idx) cannot be unified with expression (ISQLAlias)getList().getModel().getElementAt(idx) , because common superclass net.sourceforge.squirrel_sql.fw.id.IHasIdentifier does not declare member(s) public abstract java.lang.String getName()