You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Steve hammond (JIRA)" <ji...@apache.org> on 2010/10/27 23:43:21 UTC

[jira] Created: (DIRSERVER-1577) An Empty cursor list blocks any other results

An Empty cursor list blocks any other results
---------------------------------------------

                 Key: DIRSERVER-1577
                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1577
             Project: Directory ApacheDS
          Issue Type: Bug
          Components: core
    Affects Versions: 2.0.0
         Environment: Windows Eclipse
            Reporter: Steve hammond


If I create a CursorList that itself contains cursor lists, any empty list causes the next() function to return false.  In the below example if I change the order of adding to CursorList3 to add CursorList2 first, and then 1, this passes.  But the other order does not.

   public void testCursorList()
      throws Exception
   {
      SearchOperationContext opContext = new SearchOperationContext(testSession);
      ArrayList<EntryFilteringCursor> cursorArray1 = new ArrayList<EntryFilteringCursor>();
      ArrayList<EntryFilteringCursor> cursorArray2 = new ArrayList<EntryFilteringCursor>();
      ArrayList<EntryFilteringCursor> cursorArray3 = new ArrayList<EntryFilteringCursor>();
      ArrayList<Entry> results = new ArrayList<Entry>();
      DefaultEntry entry = new DefaultEntry();
      results.add(entry);
      cursorArray2.add(new BaseEntryFilteringCursor(new ListCursor<Entry>(results), opContext));
      
      CursorList cursorList1 = new CursorList(cursorArray1, opContext);
      CursorList cursorList2 = new CursorList(cursorArray2, opContext);
      cursorArray3.add(cursorList1);
      cursorArray3.add(cursorList2);
      
      CursorList cursorList3 = new CursorList(cursorArray3, opContext);

      
      assertTrue(cursorList3.next());
   }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRSERVER-1577) An Empty cursor list blocks any other results

Posted by "Steve hammond (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRSERVER-1577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12925889#action_12925889 ] 

Steve hammond commented on DIRSERVER-1577:
------------------------------------------

but a CursorList extends Cursor, therefore it can be in a list. Maybe the constructor should throw if you try to do this.  



> An Empty cursor list blocks any other results
> ---------------------------------------------
>
>                 Key: DIRSERVER-1577
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1577
>             Project: Directory ApacheDS
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 2.0.0
>         Environment: Windows Eclipse
>            Reporter: Steve hammond
>            Assignee: Kiran Ayyagari
>             Fix For: 2.0.0-RC1
>
>
> If I create a CursorList that itself contains cursor lists, any empty list causes the next() function to return false.  In the below example if I change the order of adding to CursorList3 to add CursorList2 first, and then 1, this passes.  But the other order does not.
>    public void testCursorList()
>       throws Exception
>    {
>       SearchOperationContext opContext = new SearchOperationContext(testSession);
>       ArrayList<EntryFilteringCursor> cursorArray1 = new ArrayList<EntryFilteringCursor>();
>       ArrayList<EntryFilteringCursor> cursorArray2 = new ArrayList<EntryFilteringCursor>();
>       ArrayList<EntryFilteringCursor> cursorArray3 = new ArrayList<EntryFilteringCursor>();
>       ArrayList<Entry> results = new ArrayList<Entry>();
>       DefaultEntry entry = new DefaultEntry();
>       results.add(entry);
>       cursorArray2.add(new BaseEntryFilteringCursor(new ListCursor<Entry>(results), opContext));
>       
>       CursorList cursorList1 = new CursorList(cursorArray1, opContext);
>       CursorList cursorList2 = new CursorList(cursorArray2, opContext);
>       cursorArray3.add(cursorList1);
>       cursorArray3.add(cursorList2);
>       
>       CursorList cursorList3 = new CursorList(cursorArray3, opContext);
>       
>       assertTrue(cursorList3.next());
>    }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (DIRSERVER-1577) An Empty cursor list blocks any other results

Posted by "Kiran Ayyagari (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRSERVER-1577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kiran Ayyagari closed DIRSERVER-1577.
-------------------------------------

       Resolution: Won't Fix
    Fix Version/s: 2.0.0-RC1
         Assignee: Kiran Ayyagari

This is not the correct way to use the CursorList. Let me explain, this cursor can only handle a list containing cursors, not a list containing
another list of cursors. So if you want this cursor to work you need to add only cursors to the underlying list not a list holding cursors or another list.


> An Empty cursor list blocks any other results
> ---------------------------------------------
>
>                 Key: DIRSERVER-1577
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1577
>             Project: Directory ApacheDS
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 2.0.0
>         Environment: Windows Eclipse
>            Reporter: Steve hammond
>            Assignee: Kiran Ayyagari
>             Fix For: 2.0.0-RC1
>
>
> If I create a CursorList that itself contains cursor lists, any empty list causes the next() function to return false.  In the below example if I change the order of adding to CursorList3 to add CursorList2 first, and then 1, this passes.  But the other order does not.
>    public void testCursorList()
>       throws Exception
>    {
>       SearchOperationContext opContext = new SearchOperationContext(testSession);
>       ArrayList<EntryFilteringCursor> cursorArray1 = new ArrayList<EntryFilteringCursor>();
>       ArrayList<EntryFilteringCursor> cursorArray2 = new ArrayList<EntryFilteringCursor>();
>       ArrayList<EntryFilteringCursor> cursorArray3 = new ArrayList<EntryFilteringCursor>();
>       ArrayList<Entry> results = new ArrayList<Entry>();
>       DefaultEntry entry = new DefaultEntry();
>       results.add(entry);
>       cursorArray2.add(new BaseEntryFilteringCursor(new ListCursor<Entry>(results), opContext));
>       
>       CursorList cursorList1 = new CursorList(cursorArray1, opContext);
>       CursorList cursorList2 = new CursorList(cursorArray2, opContext);
>       cursorArray3.add(cursorList1);
>       cursorArray3.add(cursorList2);
>       
>       CursorList cursorList3 = new CursorList(cursorArray3, opContext);
>       
>       assertTrue(cursorList3.next());
>    }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRSERVER-1577) An Empty cursor list blocks any other results

Posted by "Kiran Ayyagari (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRSERVER-1577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12926202#action_12926202 ] 

Kiran Ayyagari commented on DIRSERVER-1577:
-------------------------------------------

Nope, this cursor can't handle plain lists or lists within lists. (This is intended for a special purpose of handling the search
performed on RootDSE), the javadoc explicitly states a warning about its internal usage.

Having said that there is a different cursor called ListCursor which takes a list of values (again just a single list not a list inside a list and so on), *may* be you can leverage it.

> An Empty cursor list blocks any other results
> ---------------------------------------------
>
>                 Key: DIRSERVER-1577
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1577
>             Project: Directory ApacheDS
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 2.0.0
>         Environment: Windows Eclipse
>            Reporter: Steve hammond
>            Assignee: Kiran Ayyagari
>             Fix For: 2.0.0-RC1
>
>
> If I create a CursorList that itself contains cursor lists, any empty list causes the next() function to return false.  In the below example if I change the order of adding to CursorList3 to add CursorList2 first, and then 1, this passes.  But the other order does not.
>    public void testCursorList()
>       throws Exception
>    {
>       SearchOperationContext opContext = new SearchOperationContext(testSession);
>       ArrayList<EntryFilteringCursor> cursorArray1 = new ArrayList<EntryFilteringCursor>();
>       ArrayList<EntryFilteringCursor> cursorArray2 = new ArrayList<EntryFilteringCursor>();
>       ArrayList<EntryFilteringCursor> cursorArray3 = new ArrayList<EntryFilteringCursor>();
>       ArrayList<Entry> results = new ArrayList<Entry>();
>       DefaultEntry entry = new DefaultEntry();
>       results.add(entry);
>       cursorArray2.add(new BaseEntryFilteringCursor(new ListCursor<Entry>(results), opContext));
>       
>       CursorList cursorList1 = new CursorList(cursorArray1, opContext);
>       CursorList cursorList2 = new CursorList(cursorArray2, opContext);
>       cursorArray3.add(cursorList1);
>       cursorArray3.add(cursorList2);
>       
>       CursorList cursorList3 = new CursorList(cursorArray3, opContext);
>       
>       assertTrue(cursorList3.next());
>    }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.