Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
54 | 2 | 1 | 0.998 | class_body_declarations[7] |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 54 | 780 | plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java |
2 | 53 | 730 | plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/TreeListDialogField.java |
| ||||
// ------- list maintenance private List moveUp(List elements, List move) { int nElements = elements.size(); List res = new ArrayList(nElements); Object floating = null; for (int i = 0; i < nElements; i++) { Object curr = elements.get(i); if (move.contains(curr)) { res.add(curr); } else { if (floating != null) { res.add(floating); } floating = curr; } } if (floating != null) { res.add(floating); } return res; } private void moveUp(List toMoveUp) { if (toMoveUp.size() > 0) { setElements(moveUp(fElements, toMoveUp)); fTable.reveal(toMoveUp.get(0)); } } private void moveDown(List toMoveDown) { if (toMoveDown.size() > 0) { setElements(reverse(moveUp(reverse(fElements), toMoveDown))); fTable.reveal(toMoveDown.get(toMoveDown.size() - 1)); } } private List reverse(List p) { List reverse = new ArrayList(p.size()); for (int i = p.size() - 1; i >= 0; i--) { reverse.add(p.get(i)); } return reverse; } private void remove() { removeElements(getSelectedElements()); } private void up() { moveUp(getSelectedElements()); } private void down() { moveDown(getSelectedElements()); } |
| ||||
// ------- list maintenance private List moveUp(List elements, List move) { int nElements = elements.size(); List res = new ArrayList(nElements); Object floating = null; for (int i = 0; i < nElements; i++) { Object curr = elements.get(i); if (move.contains(curr)) { res.add(curr); } else { if (floating != null) { res.add(floating); } floating = curr; } } if (floating != null) { res.add(floating); } return res; } private void moveUp(List toMoveUp) { if (toMoveUp.size() > 0) { setElements(moveUp(fElements, toMoveUp)); fTree.reveal(toMoveUp.get(0)); } } private void moveDown(List toMoveDown) { if (toMoveDown.size() > 0) { setElements(reverse(moveUp(reverse(fElements), toMoveDown))); fTree.reveal(toMoveDown.get(toMoveDown.size() - 1)); } } private List reverse(List p) { List reverse = new ArrayList(p.size()); for (int i = p.size() - 1; i >= 0; i--) { reverse.add(p.get(i)); } return reverse; } private void remove() { removeElements(getSelectedElements()); } private void up() { moveUp(getSelectedElements()); } private void down() { moveDown(getSelectedElements()); } |
| |||
// ------- list maintenance private List moveUp(List elements, List move) { int nElements = elements.size(); List res = new ArrayList(nElements); Object floating = null; for (int i = 0; i < nElements; i++) { Object curr = elements.get(i); if (move.contains(curr)) { res.add(curr); } else { if (floating != null) { res.add(floating); } floating = curr; } } if (floating != null) { res.add(floating); } return res; } private void moveUp(List toMoveUp) { if (toMoveUp.size() > 0) { setElements(moveUp(fElements, toMoveUp)); [[#variablec26593e0]].reveal(toMoveUp.get(0)); } } private void moveDown(List toMoveDown) { if (toMoveDown.size() > 0) { setElements(reverse(moveUp(reverse(fElements), toMoveDown))); [[#variablec26593e0]].reveal(toMoveDown.get(toMoveDown.size() - 1)); } } private List reverse(List p) { List reverse = new ArrayList(p.size()); for (int i = p.size() - 1; i >= 0; i--) { reverse.add(p.get(i)); } return reverse; } private void remove() { removeElements(getSelectedElements()); } private void up() { moveUp(getSelectedElements()); } private void down() { moveDown(getSelectedElements()); } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#c26593e0]] | fTable |
1 | 2 | [[#c26593e0]] | fTree |