File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/properties/EditWhereColsPanel.java | File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/properties/EditWhereColsPanel.java | |||
Method name: void moveToUsed()
|
Method name: void moveToNotUsed()
|
|||
Number of AST nodes: 13 | Number of AST nodes: 13 | |||
1 | ListModel useColsModel = useColsList.getModel();↵ | 1 | ListModel notUseColsModel = notUseColsList.getModel();↵ | |
2 | SortedSet<String> useColsSet = new TreeSet<String>();↵ | 2 | SortedSet<String> notUseColsSet = new TreeSet<String>();↵ | |
3 | for (int i=0; i<useColsModel.getSize(); i++)↵ | 3 | for (int i=0; i<notUseColsModel.getSize(); i++)↵ | |
4 | useColsSet.add((String)useColsModel.getElementAt(i));↵ | 4 | notUseColsSet.add((String)notUseColsModel.getElementAt(i));↵ | |
5 | ↵ | 5 | ↵ | |
6 | // get the values from the "not use" list↵ | 6 | // get the values from the "use" list↵ | |
7 | ListModel notUseColsModel = notUseColsList.getModel();↵ | 7 | ListModel useColsModel = useColsList.getModel();↵ | |
8 | ↵ | 8 | ↵ | |
9 | // create an empty set for the "not use" list↵ | 9 | // create an empty set for the "use" list↵ | |
10 | SortedSet<Object> notUseColsSet = new TreeSet<Object>();↵ | 10 | SortedSet<Object> useColsSet = new TreeSet<Object>();↵ | |
11 | // for each element in the "not use" set, if selected then add to "use",↵ | 11 | // for each element in the "use" set, if selected then add to "not use",↵ | |
12 | // otherwise add to new "not use" set↵ | 12 | // otherwise add to new "use" set↵ | |
13 | for (int i=0; i<notUseColsModel.getSize(); i++) {↵ | 13 | for (int i=0; i<useColsModel.getSize(); i++) {↵ | |
14 | String colName = (String)notUseColsModel.getElementAt(i);↵ | 14 | String colName = (String)useColsModel.getElementAt(i);↵ | |
15 | if (notUseColsList.isSelectedIndex(i))↵ | 15 | if (useColsList.isSelectedIndex(i))↵ | |
16 | useColsSet.add(colName);↵ | 16 | notUseColsSet.add(colName);↵ | |
17 | else notUseColsSet.add(colName);↵ | 17 | else useColsSet.add(colName);↵ | |
18 | }↵ | 18 | }↵ | |
19 | ↵ | 19 | ↵ | |
20 | useColsList.setListData(useColsSet.toArray());↵ | 20 | useColsList.setListData(useColsSet.toArray());↵ | |
21 | notUseColsList.setListData(notUseColsSet.toArray()); | 21 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.6 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 53 |
Number of mapped statements | 13 |
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) | 6.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | ListModel useColsModel = useColsList.getModel(); | 5 | ListModel useColsModel = useColsList.getModel(); | ||||||||||||||||
2 | SortedSet<String> useColsSet = new TreeSet<String>(); |
| 2 | SortedSet<String> notUseColsSet = new TreeSet<String>(); | |||||||||||||||
3 | for (int i = 0; i < useColsModel.getSize(); i++) |
| 3 | for (int i = 0; i < notUseColsModel.getSize(); i++) | |||||||||||||||
4 | useColsSet.add((String)useColsModel.getElementAt(i)); |
| 4 | notUseColsSet.add((String)notUseColsModel.getElementAt(i)); | |||||||||||||||
5 | ListModel notUseColsModel = notUseColsList.getModel(); | 1 | ListModel notUseColsModel = notUseColsList.getModel(); | ||||||||||||||||
6 | SortedSet<Object> notUseColsSet = new TreeSet<Object>(); |
| 6 | SortedSet<Object> useColsSet = new TreeSet<Object>(); | |||||||||||||||
7 | for (int i = 0; i < notUseColsModel.getSize(); i++) |
| 7 | for (int i = 0; i < useColsModel.getSize(); i++) | |||||||||||||||
8 | String colName = (String)notUseColsModel.getElementAt(i); |
| 8 | String colName = (String)useColsModel.getElementAt(i); | |||||||||||||||
9 | if (notUseColsList.isSelectedIndex(i)) |
| 9 | if (useColsList.isSelectedIndex(i)) | |||||||||||||||
10 | useColsSet.add(colName); |
| 10 | notUseColsSet.add(colName); | |||||||||||||||
else | else | ||||||||||||||||||
11 | notUseColsSet.add(colName); |
| 11 | useColsSet.add(colName); | |||||||||||||||
12 | useColsList.setListData(useColsSet.toArray()); |
| 13 | notUseColsList.setListData(notUseColsSet.toArray()); | |||||||||||||||
13 | notUseColsList.setListData(notUseColsSet.toArray()); |
| 12 | useColsList.setListData(useColsSet.toArray()); |
Row | Violation |
---|---|
1 | Expression useColsModel cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression notUseColsModel cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression useColsModel cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression notUseColsModel cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression notUseColsModel cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression useColsModel cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression notUseColsModel cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression useColsModel cannot be parameterized, because it has dependencies to/from statements that will be extracted |