File path: /sql12/plugins/refactoring/src/net/sourceforge/squirrel_sql/plugins/refactoring/gui/AddForeignKeyDialog.java | File path: /sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/HibernateTabController.java | |||
Method name: void setReferencedColumns(String[])
|
Method name: void closeConnection()
|
|||
Number of AST nodes: 3 | Number of AST nodes: 3 | |||
1 | referencingBox.removeAllItems();↵ | |||
2 | for (String ref : refColums) { ↵ | 1 | _con.close();↵ | |
2 | for (ConnectionListener listener : _listeners)↵ | |||
3 | ↵ | 3 | {↵ | |
4 | referencingBox.addItem(ref);↵ | 4 | ↵ | |
5 | ↵ | 5 | listener.connectionClosed();↵ | |
6 | } | 6 |
| |
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 | 5 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 1.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| 1 | _con.close(); | |||||||||||||||||||
1 | referencingBox.removeAllItems(); | | ||||||||||||||||||||
2 | for (String ref : refColums) |
| 2 | for (ConnectionListener listener : _listeners) | ||||||||||||||||||
|
| 3 | listener.connectionClosed(); | |||||||||||||||||||
3 | referencingBox.addItem(ref); |
| |
Row | Violation |
---|---|
1 | Unmatched statement _con.close(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Type java.lang.String does not match with type net.sourceforge.squirrel_sql.plugins.hibernate.ConnectionListener |
3 | Type java.lang.String[] of variable refColums does not match with type java.util.ArrayList<net.sourceforge.squirrel_sql.plugins.hibernate.ConnectionListener> of variable _listeners |
4 | Unmatched statement listener.connectionClosed(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement referencingBox.addItem(ref); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Clone fragment #1 returns variable ref with type java.lang.String , while Clone fragment #2 returns variable listener with type net.sourceforge.squirrel_sql.plugins.hibernate.ConnectionListener |
7 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero |