File path: /sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/mapping/DetailAttribute.java | File path: /sql12/plugins/refactoring/src/net/sourceforge/squirrel_sql/plugins/refactoring/gui/DropTableDialog.java | |||
Method name: DetailAttribute[] createDetailtAttributes(PropertyInfo[])
|
Method name: String[] getSimpleNames(ITableInfo[])
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | DetailAttribute[] ret = new DetailAttribute[attributes.length];↵ | 1 | String[] result = new String[tableInfos.length];↵ | |
2 | for (int i = 0; i < attributes.length; i++)↵ | 2 | for (int i = 0; i < result.length; i++)↵ | |
3 | ↵ | 3 | {↵ | |
4 | {↵ | 4 | ↵ | |
5 | ret[i] = new DetailAttribute(attributes[i]);↵ | 5 | result[i] = tableInfos[i].getSimpleName();↵ | |
6 | }↵ | 6 | }↵ | |
7 | return ret; | 7 | return result; | |
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 8 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 1.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | String[] result = new String[tableInfos.length]; | ||||||||||||||||
1 | DetailAttribute[] ret = new DetailAttribute[attributes.length]; | | ||||||||||||||||
2 | for (int i = 0; i < attributes.length; i++) |
| 2 | for (int i = 0; i < result.length; i++) | ||||||||||||||
|
| 3 | result[i] = tableInfos[i].getSimpleName(); | |||||||||||||||
3 | ret[i] = new DetailAttribute(attributes[i]); |
| | |||||||||||||||
|
| 4 | return result; | |||||||||||||||
4 | return ret; |
| |
Row | Violation |
---|---|
1 | Type int of variable attributes.length does not match with type int of variable result.length |
2 | Unmatched statement result[i]=tableInfos[i].getSimpleName(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement ret[i]=new DetailAttribute(attributes[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched return result; |
5 | Unmatched return ret; |
6 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero |