private TextEditBasedChangeGroup[] getSortedChangeGroups(TextEditBasedChange change) { TextEditBasedChangeGroup[] edits= change.getChangeGroups(); List result= new ArrayList(edits.length); for (int i= 0; i < edits.length; i++) { if (!edits[i].getTextEditGroup().isEmpty()) result.add(edits[i]); } Comparator comparator= new OffsetComparator(); Collections.sort(result, comparator); return (TextEditBasedChangeGroup[])result.toArray(new TextEditBasedChangeGroup[result.size()]); }
private TextEditBasedChangeGroup[] getSortedChangeGroups(TextEditBasedChange change) { TextEditBasedChangeGroup[] edits= change.getChangeGroups(); List<TextEditBasedChangeGroup> result= new ArrayList<>(edits.length); for (int i= 0; i < edits.length; i++) { if (!edits[i].getTextEditGroup().isEmpty()) result.add(edits[i]); } Comparator<TextEditBasedChangeGroup> comparator= new OffsetComparator(); Collections.sort(result, comparator); return result.toArray(new TextEditBasedChangeGroup[result.size()]); }
private TextEditBasedChangeGroup[] getSortedChangeGroups(TextEditBasedChange change) { TextEditBasedChangeGroup[] groups= change.getChangeGroups(); List result= new ArrayList(groups.length); for (int i= 0; i < groups.length; i++) { if (!groups[i].getTextEditGroup().isEmpty()) result.add(groups[i]); } Comparator comparator= new OffsetComparator(); Collections.sort(result, comparator); return (TextEditBasedChangeGroup[])result.toArray(new TextEditBasedChangeGroup[result.size()]); }
private TextEditBasedChangeGroup[] getSortedChangeGroups(TextEditBasedChange change) { TextEditBasedChangeGroup[] edits= change.getChangeGroups(); List<TextEditBasedChangeGroup> result= new ArrayList<>(edits.length); for (int i= 0; i < edits.length; i++) { if (!edits[i].getTextEditGroup().isEmpty()) result.add(edits[i]); } Comparator<TextEditBasedChangeGroup> comparator= new OffsetComparator(); Collections.sort(result, comparator); return result.toArray(new TextEditBasedChangeGroup[result.size()]); }
private void collectGroupCategories(Set/*<GroupCategory>*/ result, Change change) { if (change instanceof TextEditBasedChange) { TextEditBasedChangeGroup[] groups= ((TextEditBasedChange)change).getChangeGroups(); for (int i= 0; i < groups.length; i++) { result.addAll(groups[i].getGroupCategorySet().asList()); } } else if (change instanceof CompositeChange) { Change[] children= ((CompositeChange)change).getChildren(); for (int i= 0; i < children.length; i++) { collectGroupCategories(result, children[i]); } } }