String tip = null;
final TreePath path = getPathForLocation(evt.getX(), evt.getY());
if (path != null) {
tip = path.getLastPathComponent().toString();
} else {
tip = super.getToolTipText();
}
return tip;
String tip = null;
final TreePath path = getPathForLocation(evt.getX(), evt.getY());
if (path != null)
{
tip = path.getLastPathComponent().toString();
}
else
{
tip = getToolTipText();
}
return tip;
Clone fragments detected by clone detection tool
File path: /sql12/plugins/favs/src/net/sourceforge/squirrel_sql/plugins/favs/QueryTree.java
|
|
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/ObjectTree.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 = null;↵
|
2 | final TreePath path = getPathForLocation(evt.getX(), evt.getY());↵ | | 2 | final TreePath path = getPathForLocation(evt.getX(), evt.getY());↵
|
3 | if (path != null) ↵ | | 3 | if (path != null)↵
|
4 | {↵ | | 4 | {↵
|
5 | tip = path.getLastPathComponent().toString();↵ | | 5 | tip = path.getLastPathComponent().toString();↵
|
6 | } ↵ | | 6 | }↵
|
7 | else ↵ | | 7 | else↵
|
8 | {↵ | | 8 | {↵
|
9 | tip = super.getToolTipText();↵ | | 9 | tip = getToolTipText();↵
|
10 | }↵ | | 10 | }↵
|
11 | return tip; | | 11 | return tip;
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 18 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 2.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | String tip = null; | | 1 | String tip = null; |
2 | final TreePath path = getPathForLocation(evt.getX(), evt.getY()); | | 2 | final TreePath path = getPathForLocation(evt.getX(), evt.getY()); |
3 | if (path != null) | | 3 | if (path != null) |
4 | tip = path.getLastPathComponent().toString(); | | 4 | tip = path.getLastPathComponent().toString(); |
| | | | |
5 | tip = super.getToolTipText(); | | 5 | |
6 | return tip; | | 6 | return tip; |
Precondition Violations (1)
Row |
Violation |
1 | Super method call tip=super.getToolTipText(); cannot be extracted from method |