CloneSet250


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
54210.998class_body_declarations[7]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
154780
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
253730
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/TreeListDialogField.java
Clone Instance
1
Line Count
54
Source Line
780
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.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());
        }


Clone Instance
2
Line Count
53
Source Line
730
Source File
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));
                        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());
        }


Clone AbstractionParameter Count: 1Parameter Bindings

// ------- 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 Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#c26593e0]]
fTable 
12[[#c26593e0]]
fTree