sortList sort a candidate list by its scores.

@param candidateList ArrayList
15283
private void sortList(ArrayList candidateList) {
    java.util.Collections.sort(candidateList, new java.util.Comparator() {
      public int compare(Object o1, Object o2) {
        double scoreT = ( (TagLink.Candidates) o1).getScore();
        double scoreU = ( (TagLink.Candidates) o2).getScore();
        if(scoreU > scoreT){
			return 1;
		}
        if(scoreU > scoreT){
			return -1;
		}
		return 0;
      }
    }
    );
  }
545928
public void setMetricList(java.util.Collection<MetricKeyDataPoints> metricList) {
        if (metricList == null) {
            this.metricList = null;
            return;
        }

        this.metricList = new java.util.ArrayList<MetricKeyDataPoints>(metricList);
    }
967744
public static <T> ArrayList<T> sortThis(ArrayList<T> list, Comparator<? super T> comparator)
    {
        int size = list.size();
        if (ArrayListIterate.canAccessInternalArray(list))
        {
            Arrays.sort(ArrayListIterate.getInternalArray(list), 0, size, comparator);
        }
        else
        {
            Collections.sort(list, comparator);
        }
        return list;
    }
298835
public static void sortBySpecificityAndQuality(List<MediaType> mediaTypes) {
        Assert.notNull(mediaTypes, "'mediaTypes' must not be null");
        if (mediaTypes.size() > 1) {
            Collections.sort(mediaTypes, new CompoundComparator<MediaType>(MediaType.SPECIFICITY_COMPARATOR,
                MediaType.QUALITY_VALUE_COMPARATOR));
        }
    }
1350758
private ImmutableList<ContentResult> filterPotentialMatches(List<ContentResult> candidates) {
    // Sort candidates such that those with the longest formatted strings come first.
    Collections.sort(candidates, new Comparator<ContentResult>() {
      @Override
      public int compare(ContentResult o1, ContentResult o2) {
        String o1Formatted = o1.getL10nFormatted();
        String o2Formatted = o2.getL10nFormatted();
        int o1Length = o1Formatted.length();
        int o2Length = o2Formatted.length();
        // Sort longest to shortest, then lexicographically.
        if (o1Length > o2Length) {
          return -1;
        } else if (o1Length == o2Length) {
          return o1Formatted.compareTo(o2Formatted);
        } else {
          return 1;
        }
      }
    });
    // Build the final result by filtering out ContentResult instances that with formatted strings that are contained by
    // the already selected instances' formatted strings.
    List<ContentResult> res = new ArrayList<>();
    for (ContentResult candidate : candidates) {
      boolean contained = false;
      for (ContentResult member : res) {
        if (member.getL10nFormatted().contains(candidate.getL10nFormatted())) {
          contained = true;
          break;
        }
      }
      if (!contained) {
        res.add(candidate);
      }
    }
    return ImmutableList.copyOf(res);
  }
994761
private static void sortMatchList(List<Match> list) {
    if (list != null) {
      // light sorting on start position
      Collections.sort(list, (Match m1,
          Match m2) -> (Integer.compare(m1.startPosition, m2.startPosition)));
    }
  }
817275
public List<Rc> sortByTitleAndFilterDoubles(List<Rc> rcList) {
    List<Rc> result = new ArrayList<Rc>();
    List<Rc> sorted = new ArrayList<Rc>();
    sorted.addAll(rcList);
    Collections.sort(sorted, new Comparator<Rc>() {
      @Override
      public int compare(Rc lRc, Rc rRc) {
        int result = lRc.getTitle().compareTo(rRc.getTitle());
        if (result == 0) {
          result = rRc.getTimestamp().compare(lRc.getTimestamp());
        }
        return result;
      }
    });
    Rc previous = null;
    for (Rc rc : sorted) {
      if (previous == null || (!rc.getTitle().equals(previous.getTitle()))) {
        result.add(rc);
      }
      previous = rc;
    }
    Collections.sort(result, new Comparator<Rc>() {
      @Override
      public int compare(Rc lRc, Rc rRc) {
        int result = rRc.getTimestamp().compare(lRc.getTimestamp());
        return result;
      }
    });
    return result;
  }
911600
public final void sortCatalogs(final List<TradingCatalog> pCurrentList) {
    Collections.sort(pCurrentList, this.cmprCatalogs);
    for (TradingCatalog tc : pCurrentList) {
      if (tc.getSubcatalogs().size() > 0) {
        sortCatalogs(tc.getSubcatalogs());
      }
    }
  }
884902
void sortList() {

        final List<Sortables> order = MainFrame.getInstance().getSorter().getOrderAfterDivider();

        Comparator<BugLeafNode> comparator = new Comparator<BugLeafNode>() {
            int compare(int one, int two) {
                if (one > two) {
                    return 1;
                } else if (one < two) {
                    return -1;
                }
                return 0;
            }

            @Override
            public int compare(BugLeafNode one, BugLeafNode two) {
                if (one == two) {
                    return 0;
                }
                int result;
                for (Sortables i : order) {
                    result = i.getBugLeafNodeComparator().compare(one, two);
                    if (result != 0) {
                        return result;
                    }
                }
                BugInstance bugOne = one.getBug();
                BugInstance bugTwo = two.getBug();
                result = bugOne.getPrimaryClass().getClassName().compareTo(bugTwo.getPrimaryClass().getClassName());
                if (result != 0) {
                    return result;
                }
                SourceLineAnnotation oneSource = bugOne.getPrimarySourceLineAnnotation();
                SourceLineAnnotation twoSource = bugTwo.getPrimarySourceLineAnnotation();
                result = oneSource.getClassName().compareTo(twoSource.getClassName());
                if (result != 0) {
                    return result;
                }
                result = compare(oneSource.getStartLine(), twoSource.getStartLine());
                if (result != 0) {
                    return result;
                }
                result = compare(oneSource.getEndLine(), twoSource.getEndLine());
                if (result != 0) {
                    return result;
                }
                result = compare(oneSource.getStartBytecode(), twoSource.getStartBytecode());
                if (result != 0) {
                    return result;
                }
                result = compare(oneSource.getEndBytecode(), twoSource.getEndBytecode());
                return result;

            }
        };
        ArrayList<BugLeafNode> copy = new ArrayList<>(mainList);
        Collections.sort(copy, comparator);
        mainList = copy;

        if (SystemProperties.ASSERTIONS_ENABLED) {
            for(int i = 0; i < mainList.size(); i++) {
                BugLeafNode nodeI = mainList.get(i);

                for(int j = i+1; j < mainList.size(); j++) {
                    BugLeafNode nodeJ = mainList.get(j);
                    if (comparator.compare(nodeI, nodeJ) > 0) {
                        throw new AssertionError(
                                String.format("bug list isn't consistently sorted (%d:%s) vs. (%d:%s)",
                                        i, nodeI.getBug().getInstanceHash(), j, nodeJ.getBug().getInstanceHash()));
                    }
                }}
        }



    }
546962
private int collectCandidates(Map<Long, Score> candidates,
                                List<Bucket> buckets,
                                int threshold) {
    int ix;
    for (ix = 0; ix < threshold &&
           candidates.size() < (CUTOFF_FACTOR_1 * max_search_hits); ix++) {
      Bucket b = buckets.get(ix);
      long[] ids = b.records;
      double score = b.getScore();
      
      for (int ix2 = 0; ix2 < b.nextfree; ix2++) {
        Score s = candidates.get(ids[ix2]);
        if (s == null) {
          s = new Score(ids[ix2]);
          candidates.put(ids[ix2], s);
        }
        s.score += score;
      }
      if (DEBUG)
        System.out.println("Bucket " + b.nextfree + " -> " + candidates.size());
    }
    return ix;
  }
1154235
private void addLocalCandidate(LocalCandidateWrapper candidateWrapper, boolean sort) {
		IceCandidate candidate = candidateWrapper.getCandidate();

		// Configure the candidate before registration
		candidate.setPriority(calculatePriority(candidate));

		synchronized (this.localCandidates) {
			if (!this.localCandidates.contains(candidateWrapper)) {
				this.localCandidates.add(candidateWrapper);
				sortCandidates();
			}
		}
	}
376897
public <T extends Comparable<T>> void sort(List<T> list)
    {
        sort(list, defaultComp);
    }
395449
public void sortByInstanceList(final List<Instance> _targetList,
                                   final Map<Instance, Integer> _currentList)
    {
        final List<Long> idListNew = new ArrayList<>();
        final List<Object> objectListNew = new ArrayList<>();
        for (final Instance instance : _targetList) {
            if (_currentList.containsKey(instance)) {
                final Integer i = _currentList.get(instance);
                idListNew.add(this.idList.get(i));
                objectListNew.add(this.objectList.get(i));
            }
        }
        this.idList.clear();
        this.idList.addAll(idListNew);
        this.objectList.clear();
        this.objectList.addAll(objectListNew);
    }
961461
public static <T> void sort(List<T> list, Comparator<? super T> comparator) {
		if (list instanceof RandomAccess) {
			quicksort(list, comparator);
		} else {
			List<T> copy = new ArrayList<>(list);
			quicksort(copy, comparator);
			list.clear();
			list.addAll(copy);
		}
	}
1240427
public void sort( double[] values, Object[] valuesToFollow ) {
        this.valuesToSort = values;
        this.valuesToFollow = valuesToFollow;

        number = values.length;

        monitor.beginTask("Sorting...", -1);

        monitor.worked(1);
        quicksort(0, number - 1);

        monitor.done();
    }
1111174
private void sortMethodList() {

        // order of execution is base classes first, then the order of
        // processorClasses, reversed for tear downs

        // build up the order:
        final List<Class<?>> hierarchy = new ArrayList<Class<?>>();

        if (initialisationClasses != null) {
            for (int i = initialisationClasses.length; i > 0; i--) {

                hierarchy.addAll(classHierarchyFor(initialisationClasses[i - 1]));
            }
        }
        sortMethodLists(hierarchy);
    }
99424
public void sort(final int sortCol, final boolean sortAsc) {
		int[] rowIndexMappings = getTableModel().sort(sortCol, sortAsc);
		getOrCreateComponentModel().rowIndexMapping = rowIndexMappings;

		setSort(sortCol, sortAsc);

		if (rowIndexMappings == null) {
			// There's no way to correlate the previously selected row indices
			// with the new order of rows, so we need to clear out the selection.
			setSelectedRows(null);
			setExpandedRows(null);
		}
	}