File path: /sql12/plugins/graph/src/net/sourceforge/squirrel_sql/plugins/graph/GraphTextAreaFactory.java | File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/desktopcontainer/docktabdesktop/DockTabDesktopPane.java | |||
Method name: Font getFont()
|
Method name: IWidget getSelectedWidget()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | JComponent bestReadyComponent = getBestReadyComponent();↵ | 1 | TabHandle selectedHandle = getSelectedHandle();↵ | |
2 | if(null == bestReadyComponent)↵ | 2 | if(null == selectedHandle)↵ | |
3 | {↵ | 3 | {↵ | |
4 | return null;↵ | 4 | return null;↵ | |
5 | }↵ | 5 | }↵ | |
6 | return bestReadyComponent.getGraphics().getFont(); | 6 | return selectedHandle.getWidget(); | |
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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 8 |
Number of mapped statements | 2 |
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) | 0.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | TabHandle selectedHandle = getSelectedHandle(); | ||||||||||||||||
1 | JComponent bestReadyComponent = getBestReadyComponent(); | | ||||||||||||||||
2 | if (null == bestReadyComponent) |
| 2 | if (null == selectedHandle) | ||||||||||||||
3 | return null; | 3 | return null; | |||||||||||||||
|
| 4 | return selectedHandle.getWidget(); | |||||||||||||||
4 | return bestReadyComponent.getGraphics().getFont(); |
| |
Row | Violation |
---|---|
1 | Type javax.swing.JComponent of variable bestReadyComponent does not match with type net.sourceforge.squirrel_sql.client.gui.desktopcontainer.docktabdesktop.TabHandle of variable selectedHandle |
2 | Unmatched return selectedHandle.getWidget(); |
3 | Unmatched return bestReadyComponent.getGraphics().getFont(); |
4 | Not all possible execution flows end in a return statement |