_font = font;
if (_fi == null)
{
_fi = new FontInfo(font);
}
else
{
_fi.setFont(font);
}
_dirty = true;
_font = font;
if (_fi == null)
{
_fi = new FontInfo(font);
}
else
{
_fi.setFont(font);
}
Clone fragments detected by clone detection tool
File path: /sql12/plugins/laf/src/net/sourceforge/squirrel_sql/plugins/laf/LAFFontsTab.java
|
|
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/properties/SessionSQLPropertiesPanel.java
|
Method name: void setSelectedFont(Font)
|
|
Method name: void setSelectedFont(Font)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 4
|
|
1 | _font = font;↵ | | 1 | _font = font;↵
|
2 | if (_fi == null)↵ | | 2 | if (_fi == null)↵
|
3 | {↵ | | 3 | {↵
|
4 | _fi = new FontInfo(font);↵ | | 4 | _fi = new FontInfo(font);↵
|
5 | }↵ | | 5 | }↵
|
6 | else↵ | | 6 | else↵
|
7 | {↵ | | 7 | {↵
|
8 | _fi.setFont(font);↵ | | 8 | _fi.setFont(font);↵
|
9 | }↵ | | 9 | }
|
10 | _dirty = true; | | | |
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
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 | 11 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 5.4 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | _font = font; | | 1 | _font = font; |
2 | if (_fi == null) | | 2 | if (_fi == null) |
3 | _fi = new FontInfo(font); | | 3 | _fi = new FontInfo(font); |
| | | | |
4 | | | 4 | |
5 | _dirty = true; | | | |
Precondition Violations (1)
Row |
Violation |
1 | Unmatched statement _dirty=true; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |