File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/desktopcontainer/ScrollableDesktopPane.java | File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/ObjectTree.java | |||
Method name: IWidget[] getAllWidgets()
|
Method name: IDatabaseObjectInfo[] getSelectedDatabaseObjects()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | JInternalFrame[] jInternalFrames = getAllFrames();↵ | |||
2 | IWidget[] ret = new IWidget[jInternalFram↵ | 1 | ObjectTreeNode[] nodes = getSelectedNodes();↵ | |
3 | es.length];↵ | 2 | IDatabaseObjectInfo[] dbObjects = new IDatabaseObjectInfo[nodes.length];↵ | |
4 | for (int i = 0; i < jInternalFrames.length; i++)↵ | 3 | for (int i = 0; i < nodes.length; ++i)↵ | |
5 | {↵ | |||
6 | ret[i] = ((InternalFrameDelegate)jInternalFrames[i]).getWidget();↵ | |||
7 | }↵ | |||
8 | return ret↵ | 4 | {↵ | |
5 | dbObjects[i] = nodes[i].getDatabaseObjectInfo();↵ | |||
6 | }↵ | |||
9 | ; | 7 | 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.8 |
Clones location | Clones are in different classes having the same super class |
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.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | ObjectTreeNode[] nodes = getSelectedNodes(); | ||||||||||||||||||||||||||||
1 | JInternalFrame[] jInternalFrames = getAllFrames(); | | ||||||||||||||||||||||||||||
| 2 | IDatabaseObjectInfo[] dbObjects = new IDatabaseObjectInfo[nodes.length]; | ||||||||||||||||||||||||||||
2 | IWidget[] ret = new IWidget[jInternalFrames.length]; | | ||||||||||||||||||||||||||||
3 | for (int i = 0; i < jInternalFrames.length; i++) |
| 3 | for (int i = 0; i < nodes.length; ++i) | ||||||||||||||||||||||||||
|
| 4 | dbObjects[i] = nodes[i].getDatabaseObjectInfo(); | |||||||||||||||||||||||||||
4 | ret[i] = ((InternalFrameDelegate)jInternalFrames[i]).getWidget(); |
| | |||||||||||||||||||||||||||
|
| 5 | return dbObjects; | |||||||||||||||||||||||||||
5 | return ret; |
| |
Row | Violation |
---|---|
1 | Type int of variable jInternalFrames.length does not match with type int of variable nodes.length |
2 | Type int of variable jInternalFrames.length does not match with type int of variable nodes.length |
3 | Type javax.swing.JInternalFrame[] of variable jInternalFrames does not match with type int of variable nodes.length |
4 | Type int of variable jInternalFrames.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 ret[i]=((InternalFrameDelegate)jInternalFrames[i]).getWidget(); 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 ret; |
9 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero |