File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/gui/SortedComboBoxModel.java | File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/gui/SortedListModel.java | |||
Method name: int getIndexInList(Object)
|
Method name: int getIndexInList(Object)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | final int limit = getSize();↵ | 1 | final int limit = getSize();↵ | |
2 | final String objStr = obj.toString();↵ | 2 | final String objStr = obj.toString();↵ | |
3 | for (int i = 0; i < limit; ++i)↵ | 3 | for (int i = 0; i < limit; ++i)↵ | |
4 | {↵ | 4 | {↵ | |
5 | if (objStr.compareToIgnoreCase(getElementAt(i).toString()) <= 0)↵ | 5 | if (objStr.compareToIgnoreCase(get(i).toString()) <= 0)↵ | |
6 | {↵ | 6 | {↵ | |
7 | return i;↵ | 7 | return i;↵ | |
8 | }↵ | 8 | }↵ | |
9 | }↵ | 9 | }↵ | |
10 | return limit; | 10 |
| |
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.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 14 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | final int limit = getSize(); | 1 | final int limit = getSize(); | |||||||||||||
2 | final String objStr = obj.toString(); | 2 | final String objStr = obj.toString(); | |||||||||||||
3 | for (int i = 0; i < limit; ++i) | 3 | for (int i = 0; i < limit; ++i) | |||||||||||||
4 | if (objStr.compareToIgnoreCase(getElementAt(i).toString()) <= 0) |
| 4 | if (objStr.compareToIgnoreCase(get(i).toString()) <= 0) | ||||||||||||
5 | return i; | 5 | return i; | |||||||||||||
6 | return limit; | 6 | return limit; |
Row | Violation |
---|---|
1 | Expression getElementAt(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression get(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.fw.gui.SortedComboBoxModel and net.sourceforge.squirrel_sql.fw.gui.SortedListModel do not have a common superclass |