Uploaded image for project: 'Crowd Data Center'
  1. Crowd Data Center
  2. CWD-3160

SpringLDAPConnector returns ImmutableList which can't be sorted by ViewGroupMembers class

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Low
    • 2.6.1
    • 2.6
    • Directory - LDAP
    • None

    Description

      I already raised a support issue but they said that this is more of a developer question. So i try to explain it here since i really think this is a bug:

      We are trying to update to Crowd Version 2.6.0 from Crowd Version 2.5.0. We are running our own implementation of a LDAP directory based on the OpenDS.java class.
      So far our implementation ran fine. Except we are getting a exception when viewing Direct Members of a Group:

      2013-02-25 11:34:31,948 http-8095-5 ERROR [console.action.group.ViewGroupMembers] 
      java.lang.UnsupportedOperationException
      	at com.google.common.collect.UnmodifiableListIterator.set(UnmodifiableListIterator.java:51)
      	at java.util.Collections.sort(Collections.java:161)
      	at com.atlassian.crowd.console.action.group.ViewGroupMembers.execute(ViewGroupMembers.java:60)
      

      None of the code we added was involved, so i tried to nail the problem down.
      I got myself the source of the 2.6.0 Crowd. After some searching i found the following lines inside the ViewGroupMembers class:

      List<User> principalsList = directoryManager.searchDirectGroupRelationships(directoryID, QueryBuilder.queryFor(User.class, EntityDescriptor.user()).childrenOf(EntityDescriptor.group(GroupType.GROUP)).withName(groupName).returningAtMost(EntityQuery.ALL_RESULTS));
                      Collections.sort(principalsList, EntityComparator.of(User.class));
                      principals = principalsList; // sort the list
      

      The sorting is where the exception happens.
      The used line in your basic SpringLDAPConnector.java implementation shows that the used method returns a ImmutableList:

      Line 1415:
              return ImmutableList.copyOf(results);
      

      This is different from the Version 2.5.0 of the SpringLDAPConnector.java, there on line 1396 only the result without converting it to a ImmutableList is returned.

      I dont know if this is a problem with other people too or am i missing something here ?

      Attachments

        Issue Links

          Activity

            People

              dberrueta Diego Berrueta
              riad.shalaby Administrator
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: