File path: /ArgoUML-0.34-src/argouml/src/argouml-app/src/org/argouml/uml/ui/UMLAddDialog.java | File path: /ArgoUML-0.34-src/argouml/src/argouml-app/src/org/argouml/uml/ui/UMLAddDialog.java | |||
Method name: Vector getSelected()
|
Method name: List getChoices()
|
|||
Number of AST nodes: 2 | Number of AST nodes: 2 | |||
1 | /** | 1 | /** | |
2 | * Returns the elements of the right-hand "selected" list. Note | 2 | * Returns the choices a user can make. | |
3 | * that these are not the elements selected (ie highlighted) in the | 3 | * @return List of choices | |
4 | * Swing sense, but rather the entire contents of the list containing | 4 | */ | |
5 | * the user selections. | 5 | private List getChoices() { | |
6 | * | 6 | List result = new ArrayList(); | |
7 | * @return a Vector of selected elements. | 7 | for (int index : choicesList.getSelectedIndices()) { | |
8 | */ | 8 | result.add(choicesList.getModel().getElementAt(index)); | |
9 | public Vector getSelected() { | 9 | } | |
10 | Vector result = new Vector(); | 10 | return result; | |
11 | ListModel list = selectedList.getModel(); | 11 | } | |
12 | for (int i = 0; i < list.getSize(); i++) { | |||
13 | result.add(list.getElementAt(i)); | |||
14 | } | |||
15 | return result; | |||
16 | } | |||
See real code fragment | See real code fragment |
Number of mapped statements | 2 |
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) | 0.0 |
Similarity Score | 0.571 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | for (int i = 0; i < list.getSize(); i++) |
| 2 | for (int index : choicesList.getSelectedIndices()) | ||||||||||||||||||
4 | result.add(list.getElementAt(i)); |
| 3 | result.add(choicesList.getModel().getElementAt(index)); |
Row | Violation |
---|---|
1 | Type javax.swing.ListModel of variable list does not match with type int[] of variable choicesList.getSelectedIndices() |
2 | Type javax.swing.ListModel of variable list does not match with type int[] of variable choicesList.getSelectedIndices() |
3 | Expression i cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression index cannot be parameterized, because it has dependencies to/from statements that will be extracted |