@Override public List<Completion> getCompletions(JTextComponent comp) { List<Completion> completions = getCompletionsImpl(comp); if (parent!=null) { List<Completion> parentCompletions = parent.getCompletions(comp); if (parentCompletions!=null) { completions.addAll(parentCompletions); Collections.sort(completions); } } // NOTE: We can't sort by relevance prior to this; we need to have // things alphabetical so we can easily narrow down completions to // those starting with what was already typed. if (/*sortByRelevance*/true) { Collections.sort(completions, SORT_BY_RELEVANCE_COMPARATOR); } return completions; }