if (null == _tempSqlHistoryItemWrappers)
{
// I have seen the reference to the outer class being null
// when this method is called.
// I have seen it only with the runtime jars
// and on Linux.
// I could not reproduce in my IDE.
return 0;
}
else
{
return _tempSqlHistoryItemWrappers.size();
}
if(null == _bundles)
{
return 0;
}
else
{
return _bundles.length;
}
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/SQLHistoryController.java
|
|
File path: /sql12/plugins/i18n/src/net/sourceforge/squirrel_sql/plugins/i18n/BundlesTableModel.java
|
Method name: int getRowCount()
|
|
Method name: int getRowCount()
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | if (null == _tempSqlHistoryItemWrappers)↵ | | 1 | if(null == _↵
|
2 | {↵ | | |
|
3 | // I have seen the reference to the outer class being null↵ | | |
|
4 | // when this method is called.↵ | | |
|
5 | // I have seen it only with the runtime jars↵ | | |
|
6 | // and on Linux.↵ | | |
|
7 | // I could not reproduce in my IDE.↵ | | |
|
8 | ↵ | | 2 | bundles)↵
|
| | | 3 | {↵
|
9 | return 0;↵ | | 4 | return 0;↵
|
10 | }↵ | | 5 | ↵
|
11 | ↵ | | 6 | }↵
|
12 | else↵ | | 7 | else↵
|
13 | {↵ | | 8 | ↵
|
14 | ↵ | | 9 | {↵
|
15 | return _tempSqlHistoryItemWrappers.size();↵ | | 10 | return _↵
|
16 | ↵ | | 11 | bundles.length;↵
|
17 | } | | 12 | }
|
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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 9 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 3 |
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) | 1.2 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (null == _tempSqlHistoryItemWrappers) | | 1 | if (null == _bundles) |
2 | | | 2 | |
| | | | |
3 | return _tempSqlHistoryItemWrappers.size(); | | 3 | |
Precondition Violations (3)
Row |
Violation |
1 | Type java.util.ArrayList<net.sourceforge.squirrel_sql.client.session.mainpanel.SQLHistoryItemWrapper> of variable _tempSqlHistoryItemWrappers does not match with type net.sourceforge.squirrel_sql.plugins.i18n.I18nBundle[] of variable _bundles |
2 | Expression _tempSqlHistoryItemWrappers.size() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression _bundles.length cannot be parameterized, because it has dependencies to/from statements that will be extracted |