if (it.hasNext())
{
_prefs = (OyoahaPreferences)it.next();
}
else
{
_prefs = new OyoahaPreferences();
try
{
cache.add(_prefs);
}
catch (DuplicateObjectException ex)
{
s_log.error("OyoahaPreferences object already in XMLObjectCache", ex);
}
}
if (it.hasNext())
{
_prefs = (TonicPreferences)it.next();
}
else
{
_prefs = new TonicPreferences();
try
{
cache.add(_prefs);
}
catch (DuplicateObjectException ex)
{
s_log.error("TonicPreferences object already in XMLObjectCache", ex);
}
}
Clone fragments detected by clone detection tool
File path: /sql12/plugins/laf/src/net/sourceforge/squirrel_sql/plugins/laf/OyoahaLookAndFeelController.java
|
|
File path: /sql12/plugins/laf/src/net/sourceforge/squirrel_sql/plugins/laf/TonicLookAndFeelController.java
|
Method name: void OyoahaLookAndFeelController(LAFPlugin)
|
|
Method name: void TonicLookAndFeelController(LAFPlugin)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (it.hasNext())↵ | | 1 | if (it.hasNext())↵
|
2 | {↵ | | 2 | {↵
|
3 | _prefs = (OyoahaPreferences)it.next();↵ | | 3 | _prefs = (TonicPreferences)it.next();↵
|
4 | }↵ | | 4 | }↵
|
5 | else↵ | | 5 | else↵
|
6 | {↵ | | 6 | {↵
|
7 | _prefs = new OyoahaPreferences();↵ | | 7 | _prefs = new TonicPreferences();↵
|
8 | try↵ | | 8 | try↵
|
9 | {↵ | | 9 | {↵
|
10 | cache.add(_prefs);↵ | | 10 | cache.add(_prefs);↵
|
11 | }↵ | | 11 | }↵
|
12 | catch (DuplicateObjectException ex)↵ | | 12 | catch (DuplicateObjectException ex)↵
|
13 | {↵ | | 13 | {↵
|
14 | s_log.error("OyoahaPreferences object already in XMLObjectCache", ex);↵ | | 14 | s_log.error("TonicPreferences object already in XMLObjectCache", ex);↵
|
15 | }↵ | | 15 | }↵
|
16 | } | | 16 | }
|
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.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 13 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
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.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
4 | if (it.hasNext()) | | 4 | if (it.hasNext()) |
5 | _prefs = (OyoahaPreferences)it.next(); | | 5 | _prefs = (TonicPreferences)it.next(); |
| | | | |
6 | _prefs = new OyoahaPreferences(); | | 6 | _prefs = new TonicPreferences(); |
7 | try | | 7 | try |
8 | | | 8 | |
Precondition Violations (2)
Row |
Violation |
1 | Expression (OyoahaPreferences)it.next() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression (TonicPreferences)it.next() cannot be parameterized, because it has dependencies to/from statements that will be extracted |