Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-9680

Forward port to Trunk: ReferringDocumentsProvider should use path instead of node name in sorting method

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • 3.1.1
    • 4.0.0
    • None
    • None

    Description

      Forward port CMS-9621 to trunk: ReferringDocumentsProvider should use path instead of node name in sorting method

      Right now it reports wrong number of referred documents.
      method:
      private static SortedSet<Node> getSortedReferrers(final Collection<Node> nodes) throws RepositoryException {
      final TreeSet<Node> sorted = new TreeSet<>(new Comparator<Node>() {
      @Override
      public int compare(final Node node1, final Node node2)

      { try { return node1.getName().compareTo(node2.getName()); }

      catch (RepositoryException e)

      { throw new RepositoryRuntimeException(e); }
      }
      });
      sorted.addAll(nodes);
      return sorted;
      }



      should be:

      private static SortedSet<Node> getSortedReferrers(final Collection<Node> nodes) throws RepositoryException {
      final TreeSet<Node> sorted = new TreeSet<>(new Comparator<Node>() {
      @Override
      public int compare(final Node node1, final Node node2) {
      try { return node1.getPath().compareTo(node2.getPath()); } catch (RepositoryException e) { throw new RepositoryRuntimeException(e); }

      }
      });
      sorted.addAll(nodes);
      return sorted;
      }

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              llemos Luís Pedro Lemos (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: