File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/util/LocaleUtils.java | File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/desktopcontainer/ScrollableDesktopPane.java | |||
Method name: String[] getAvailableLocaleStrings()
|
Method name: IWidget[] getAllWidgets()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | Locale[] availableLocales = getAvailableLocales();↵ | |||
2 | String↵ | 1 | JInternalFrame[] jInternalFrames = getAllFrames();↵ | |
3 | [] result = new String[availableLocales.length];↵ | 2 | IWidget[] ret = new IWidget[jInternalFrames.length];↵ | |
4 | for (int i = 0; i < availableLocales.length; i++) {↵ | 3 | for (int i = 0; i < jInternalFrames.length; i++)↵ | |
5 | result[i] = availableLocales[i].toString();↵ | |||
6 | }↵ | |||
7 | ↵ | |||
4 | {↵ | |||
5 | ret[i] = ((InternalFrameDelegate)jInternalFrames[i]).getWidget();↵ | |||
6 | }↵ | |||
8 | return result; | 7 | return ret; | |
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 | 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) | 1.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | JInternalFrame[] jInternalFrames = getAllFrames(); | ||||||||||||||||
1 | Locale[] availableLocales = getAvailableLocales(); | | ||||||||||||||||
| 2 | IWidget[] ret = new IWidget[jInternalFrames.length]; | ||||||||||||||||
2 | String[] result = new String[availableLocales.length]; | | ||||||||||||||||
3 | for (int i = 0; i < availableLocales.length; i++) |
| 3 | for (int i = 0; i < jInternalFrames.length; i++) | ||||||||||||||
|
| 4 | ret[i] = ((InternalFrameDelegate)jInternalFrames[i]).getWidget(); | |||||||||||||||
4 | result[i] = availableLocales[i].toString(); |
| | |||||||||||||||
|
| 5 | return ret; | |||||||||||||||
5 | return result; |
| |
Row | Violation |
---|---|
1 | Type int of variable availableLocales.length does not match with type int of variable jInternalFrames.length |
2 | 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 |
3 | Unmatched statement result[i]=availableLocales[i].toString(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched return ret; |
5 | Unmatched return result; |
6 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero |