Details
-
Bug
-
Resolution: Fixed
-
Low
-
2.9, 2.9.1, 2.9.2, 2.9.3, 2.10, 2.10.1, 2.10.2, 2.10.3, 2.10.4, 3.0, 3.0.1, 3.0.2, 3.1, 3.1.1
Description
The class com.atlassian.confluence.pages.ChildPositionComparator. Here is the simple code:
/** * @deprecated since 2.9 use Page.CHILD_POSITION_COMPARATOR * A comparator used to sort pages based on the Page Ordering sort rules. * <p/> * This comparator will compare the position of the two pages with <code>null</code> * smaller than anything else. If that comparison results in 0 a title based * "natural" sort will be used. For details on the Natural Sort algorithm * see the {@link com.atlassian.confluence.pages.NaturalStringComparator}. */ public class ChildPositionComparator implements Comparator<Page> { public int compare(Page page0, Page page1) { return Page.CHILD_PAGE_COMPARATOR.compare(page0, page1); } }
Unfortunately Page.CHILD_PAGE_COMPARATOR is package local final, so we cant use that. In addition, this comparator class itself is an private static inner class of Page. I recommend making the variable public, or providing a recommendation on how to get a child page comparator for use in plugins without requiring to use packaging hacks.