File path: /sql12/plugins/refactoring/src/net/sourceforge/squirrel_sql/plugins/refactoring/gui/AddUniqueConstraintDialog.java | File path: /sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/HibernateTabController.java | |||
Method name: void setLocalColumns(String[])
|
Method name: void closeConnection()
|
|||
Number of AST nodes: 3 | Number of AST nodes: 3 | |||
1 | localColumBox.removeAllItems();↵ | |||
2 | for (String colum : localColums)↵ | |||
3 | {↵ | |||
4 | localColumBox.addItem(colum);↵ | |||
5 | ↵ | 1 | _con.close();↵ | |
2 | for (ConnectionListener listener : _listeners)↵ | |||
3 | {↵ | |||
4 | listener.connectionClosed();↵ | |||
6 | } | 5 | } | |
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.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| 1 | _con.close(); | |||||||||||||||||||
1 | localColumBox.removeAllItems(); | | ||||||||||||||||||||
2 | for (String colum : localColums) |
| 2 | for (ConnectionListener listener : _listeners) | ||||||||||||||||||
|
| 3 | listener.connectionClosed(); | |||||||||||||||||||
3 | localColumBox.addItem(colum); |
| |
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 localColums 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 localColumBox.addItem(colum); 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 colum 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 |