File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/util/LocaleUtils.java | File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/ObjectTree.java | |||
Method name: String[] getAvailableLocaleStrings()
|
Method name: IDatabaseObjectInfo[] getSelectedDatabaseObjects()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | Locale[] availableLocales = getAvailableLocales();↵ | |||
2 | String[] result = new String[availableLocal↵ | 1 | ObjectTreeNode[] nodes = getSelectedNodes();↵ | |
3 | es.length];↵ | 2 | IDatabaseObjectInfo[] dbObjects = new IDatabaseObjectInfo[nodes.length];↵ | |
4 | for (int i = 0; i < availableLocales.length; i++) {↵ | 3 | for (int i = 0; i < nodes.length; ++↵ | |
5 | result[i] = availableLocales[i].toString↵ | 4 | i)↵ | |
5 | {↵ | |||
6 | ();↵ | 6 | dbObjects[i] = nodes[i].getDatabaseObjectInfo();↵ | |
7 | }↵ | 7 | }↵ | |
8 | return result; | 8 | return dbObjects; | |
See real code fragment | See real code fragment |
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.9 |
Clones location | Clones are in different classes |
Number of node comparisons | 13 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 2.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | ObjectTreeNode[] nodes = getSelectedNodes(); | ||||||||||||||||||||||||||||
1 | Locale[] availableLocales = getAvailableLocales(); | | ||||||||||||||||||||||||||||
| 2 | IDatabaseObjectInfo[] dbObjects = new IDatabaseObjectInfo[nodes.length]; | ||||||||||||||||||||||||||||
2 | String[] result = new String[availableLocales.length]; | | ||||||||||||||||||||||||||||
3 | for (int i = 0; i < availableLocales.length; i++) |
| 3 | for (int i = 0; i < nodes.length; ++i) | ||||||||||||||||||||||||||
|
| 4 | dbObjects[i] = nodes[i].getDatabaseObjectInfo(); | |||||||||||||||||||||||||||
4 | result[i] = availableLocales[i].toString(); |
| | |||||||||||||||||||||||||||
|
| 5 | return dbObjects; | |||||||||||||||||||||||||||
5 | return result; |
| |
Row | Violation |
---|---|
1 | Type int of variable availableLocales.length does not match with type int of variable nodes.length |
2 | Type int of variable availableLocales.length does not match with type int of variable nodes.length |
3 | Type java.util.Locale[] of variable availableLocales does not match with type int of variable nodes.length |
4 | Type int of variable availableLocales.length does not match with type net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTreeNode[] of variable nodes |
5 | Unmatched statement dbObjects[i]=nodes[i].getDatabaseObjectInfo(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement result[i]=availableLocales[i].toString(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Unmatched return dbObjects; |
8 | Unmatched return result; |
9 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero |