You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jspwiki.apache.org by "Greg Kable (JIRA)" <ji...@apache.org> on 2009/04/30 08:05:30 UTC

[jira] Created: (JSPWIKI-528) Rationalise the use of Collections, particularly with regard to pages

Rationalise the use of Collections, particularly with regard to pages
---------------------------------------------------------------------

                 Key: JSPWIKI-528
                 URL: https://issues.apache.org/jira/browse/JSPWIKI-528
             Project: JSPWiki
          Issue Type: Improvement
            Reporter: Greg Kable
            Priority: Minor


Most of the APIs return Collection rather than a finer interface and in many cases these collections are repeatedly repacked and resorted unnecessarily. I will go through all APIs that return collections of pages and make them return a finer interface - probably List for unordered collections and SortedSet for ordered collections. This will make the use of these collections much clearer for further development and give us some opportunity for future optimisations.

This is likely to be a very wide set of changes across lots of different classes so I'll submit separate patches for each class.


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


[jira] Updated: (JSPWIKI-528) Rationalise the use of Collections, particularly with regard to pages

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

Greg Kable updated JSPWIKI-528:
-------------------------------

    Attachment: jspwiki-528-LinkCollector.patch

First patch - LinkCollector.

Changed return type of getLinks from Collector to List.  No functional changes at all in this or any calling class.

> Rationalise the use of Collections, particularly with regard to pages
> ---------------------------------------------------------------------
>
>                 Key: JSPWIKI-528
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-528
>             Project: JSPWiki
>          Issue Type: Improvement
>            Reporter: Greg Kable
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: jspwiki-528-LinkCollector.patch
>
>
> Most of the APIs return Collection rather than a finer interface and in many cases these collections are repeatedly repacked and resorted unnecessarily. I will go through all APIs that return collections of pages and make them return a finer interface - probably List for unordered collections and SortedSet for ordered collections. This will make the use of these collections much clearer for further development and give us some opportunity for future optimisations.
> This is likely to be a very wide set of changes across lots of different classes so I'll submit separate patches for each class.

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


[jira] Commented: (JSPWIKI-528) Rationalise the use of Collections, particularly with regard to pages

Posted by "Andrew Jaquith (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12707873#action_12707873 ] 

Andrew Jaquith commented on JSPWIKI-528:
----------------------------------------

I reviewed and partially applied the remainder of Greg's patches. The changes to ComtentManager, WikiEngine and several plugins I made go further than those specified in the patches. For example,  AbstractFilteredPlugin.filterCollection now completely eliminates the need to create new wrapper collections for containing filtered items. 

Notable changes compared to Greg's patches include using Lists for return types instead of SortedSets. For those methods that need sorted LIsts (for example, various plugins), I have the callers use Collections.sort() instead. 

Also, I chose a different idiom for the method signatures that indicate when Lists should be sorted. Instead of creating a method ContentManager.getAllPagesSorted( String space ) as suggested in the patch, I created an alternate method getAllPages(String,Comparator<WikiPage>) that makes the sort request explicit (via the Comparator) and is also customizable. In addition, to allowed returned Lists to be sorted simply using Collections,sort(), WikiPage now extends Comparable<WikiPage>, as does JCRWikiPage. While these changes aren't exactly what Greg specified, they accomplish the same goal.

Greg, thanks for putting these patches together. They were well-researched and high quality. If the alternative fixes I've implemented don't give you exactly what you need, let me know and we can adjust further.

> Rationalise the use of Collections, particularly with regard to pages
> ---------------------------------------------------------------------
>
>                 Key: JSPWIKI-528
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-528
>             Project: JSPWiki
>          Issue Type: Improvement
>            Reporter: Greg Kable
>            Assignee: Andrew Jaquith
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: jspwiki-528-AbstractFilteredPlugin.patch, jspwiki-528-AttachmentHandler.patch, jspwiki-528-ContentManager.patch, jspwiki-528-LinkCollector.patch, jspwiki-528-SearchProviders.patch, jspwiki-528-Weblog.patch, jspwiki-528-WikiEngine-771034.patch, jspwiki-528-WikiEngine.patch, jspwiki-528-WikiPage.patch, jspwiki-528-workflow.Step.patch
>
>
> Most of the APIs return Collection rather than a finer interface and in many cases these collections are repeatedly repacked and resorted unnecessarily. I will go through all APIs that return collections of pages and make them return a finer interface - probably List for unordered collections and SortedSet for ordered collections. This will make the use of these collections much clearer for further development and give us some opportunity for future optimisations.
> This is likely to be a very wide set of changes across lots of different classes so I'll submit separate patches for each class.

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


[jira] Updated: (JSPWIKI-528) Rationalise the use of Collections, particularly with regard to pages

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

Janne Jalkanen updated JSPWIKI-528:
-----------------------------------

    Fix Version/s: 3.0

Tagging for 3.0. Good cleanup effort, thanks!

> Rationalise the use of Collections, particularly with regard to pages
> ---------------------------------------------------------------------
>
>                 Key: JSPWIKI-528
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-528
>             Project: JSPWiki
>          Issue Type: Improvement
>            Reporter: Greg Kable
>            Priority: Minor
>             Fix For: 3.0
>
>
> Most of the APIs return Collection rather than a finer interface and in many cases these collections are repeatedly repacked and resorted unnecessarily. I will go through all APIs that return collections of pages and make them return a finer interface - probably List for unordered collections and SortedSet for ordered collections. This will make the use of these collections much clearer for further development and give us some opportunity for future optimisations.
> This is likely to be a very wide set of changes across lots of different classes so I'll submit separate patches for each class.

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


[jira] Updated: (JSPWIKI-528) Rationalise the use of Collections, particularly with regard to pages

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

Greg Kable updated JSPWIKI-528:
-------------------------------

    Attachment: jspwiki-528-WikiEngine.patch

patch 7 - jspwiki-528-WikiEngine.patch

Changes to org.apache.wiki.WikiEngine:
- Change getAllInterWikiLinks to return a List instead of a Collection
- Change getAllInlinedImagePatterns to return a List instead of a Collection
- Change getRecentChanges to return a List instead of a Collection
- As per FixMe, change getRecentChanges to take a date parameter
- Change findPages to return a List instead of a Collection
- Update javadoc to match APIs

Changes to JSPWikiMarkupParser:
- Change getImagePatterns to return a List instead of a Collection

Changes to RecentChangesPlugin:
- Use new WikiEngine.getRecentChanges

Changes to RSSGenerator
- Use new WikiEngine.getRecentChanges

Changes to AbstractRPCHandler
- Use new WikiEngine.getRecentChanges

Changes to RPCHandler
- Use new WikiEngine.getRecentChanges

Changes to RPCHandlerUTF8
- Use new WikiEngine.getRecentChanges



> Rationalise the use of Collections, particularly with regard to pages
> ---------------------------------------------------------------------
>
>                 Key: JSPWIKI-528
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-528
>             Project: JSPWiki
>          Issue Type: Improvement
>            Reporter: Greg Kable
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: jspwiki-528-AbstractFilteredPlugin.patch, jspwiki-528-AttachmentHandler.patch, jspwiki-528-LinkCollector.patch, jspwiki-528-SearchProviders.patch, jspwiki-528-Weblog.patch, jspwiki-528-WikiEngine.patch, jspwiki-528-WikiPage.patch, jspwiki-528-workflow.Step.patch
>
>
> Most of the APIs return Collection rather than a finer interface and in many cases these collections are repeatedly repacked and resorted unnecessarily. I will go through all APIs that return collections of pages and make them return a finer interface - probably List for unordered collections and SortedSet for ordered collections. This will make the use of these collections much clearer for further development and give us some opportunity for future optimisations.
> This is likely to be a very wide set of changes across lots of different classes so I'll submit separate patches for each class.

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


[jira] Updated: (JSPWIKI-528) Rationalise the use of Collections, particularly with regard to pages

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

Greg Kable updated JSPWIKI-528:
-------------------------------

    Attachment: jspwiki-528-AttachmentHandler.patch

Patch number two - AttachmentManager.

- Changed the return type of listAttachments to List<WikiPage>
- Added a new method - SortedSet<WikiPage> listAttachmentsSorted which returns a sorted set of attachments
- Changed hasAttachments to be more efficient

> Rationalise the use of Collections, particularly with regard to pages
> ---------------------------------------------------------------------
>
>                 Key: JSPWIKI-528
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-528
>             Project: JSPWiki
>          Issue Type: Improvement
>            Reporter: Greg Kable
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: jspwiki-528-AttachmentHandler.patch, jspwiki-528-LinkCollector.patch
>
>
> Most of the APIs return Collection rather than a finer interface and in many cases these collections are repeatedly repacked and resorted unnecessarily. I will go through all APIs that return collections of pages and make them return a finer interface - probably List for unordered collections and SortedSet for ordered collections. This will make the use of these collections much clearer for further development and give us some opportunity for future optimisations.
> This is likely to be a very wide set of changes across lots of different classes so I'll submit separate patches for each class.

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


[jira] Commented: (JSPWIKI-528) Rationalise the use of Collections, particularly with regard to pages

Posted by "Harry Metske (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12707689#action_12707689 ] 

Harry Metske commented on JSPWIKI-528:
--------------------------------------

Applied  jspwiki-528-Weblog.patch and jspwiki-528-workflow.Step.patch.

The remaining patches don't fit anymore, mostly because Andrew's patches from the last two weeks already changed a lot of Collections into Lists.
Could you check what is still missing now ?

Harry

> Rationalise the use of Collections, particularly with regard to pages
> ---------------------------------------------------------------------
>
>                 Key: JSPWIKI-528
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-528
>             Project: JSPWiki
>          Issue Type: Improvement
>            Reporter: Greg Kable
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: jspwiki-528-AbstractFilteredPlugin.patch, jspwiki-528-AttachmentHandler.patch, jspwiki-528-ContentManager.patch, jspwiki-528-LinkCollector.patch, jspwiki-528-SearchProviders.patch, jspwiki-528-Weblog.patch, jspwiki-528-WikiEngine-771034.patch, jspwiki-528-WikiEngine.patch, jspwiki-528-WikiPage.patch, jspwiki-528-workflow.Step.patch
>
>
> Most of the APIs return Collection rather than a finer interface and in many cases these collections are repeatedly repacked and resorted unnecessarily. I will go through all APIs that return collections of pages and make them return a finer interface - probably List for unordered collections and SortedSet for ordered collections. This will make the use of these collections much clearer for further development and give us some opportunity for future optimisations.
> This is likely to be a very wide set of changes across lots of different classes so I'll submit separate patches for each class.

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


[jira] Updated: (JSPWIKI-528) Rationalise the use of Collections, particularly with regard to pages

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

Greg Kable updated JSPWIKI-528:
-------------------------------

    Attachment: jspwiki-528-WikiPage.patch

Patch 7 - jspwiki-528-WikiPage.patch

Changes to JCRWikiPage:
- Change getRefersTo to return a List instead of a Collection

Changes to WikiPage:
- Change getRefersTo to return a List instead of a Collection

Changes to ReferenceManager.java
- Fix pathological use of List.contains in internalUpdateReferences

> Rationalise the use of Collections, particularly with regard to pages
> ---------------------------------------------------------------------
>
>                 Key: JSPWIKI-528
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-528
>             Project: JSPWiki
>          Issue Type: Improvement
>            Reporter: Greg Kable
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: jspwiki-528-AbstractFilteredPlugin.patch, jspwiki-528-AttachmentHandler.patch, jspwiki-528-LinkCollector.patch, jspwiki-528-SearchProviders.patch, jspwiki-528-Weblog.patch, jspwiki-528-WikiPage.patch, jspwiki-528-workflow.Step.patch
>
>
> Most of the APIs return Collection rather than a finer interface and in many cases these collections are repeatedly repacked and resorted unnecessarily. I will go through all APIs that return collections of pages and make them return a finer interface - probably List for unordered collections and SortedSet for ordered collections. This will make the use of these collections much clearer for further development and give us some opportunity for future optimisations.
> This is likely to be a very wide set of changes across lots of different classes so I'll submit separate patches for each class.

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


[jira] Commented: (JSPWIKI-528) Rationalise the use of Collections, particularly with regard to pages

Posted by "Andrew Jaquith (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12707787#action_12707787 ] 

Andrew Jaquith commented on JSPWIKI-528:
----------------------------------------

I'm working on the remaining items. I've chosen to tackle this a little differently than the way Greg proposed, but the end results should be quite satisfactory for all parties. Will check these in soon (likely later today).

> Rationalise the use of Collections, particularly with regard to pages
> ---------------------------------------------------------------------
>
>                 Key: JSPWIKI-528
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-528
>             Project: JSPWiki
>          Issue Type: Improvement
>            Reporter: Greg Kable
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: jspwiki-528-AbstractFilteredPlugin.patch, jspwiki-528-AttachmentHandler.patch, jspwiki-528-ContentManager.patch, jspwiki-528-LinkCollector.patch, jspwiki-528-SearchProviders.patch, jspwiki-528-Weblog.patch, jspwiki-528-WikiEngine-771034.patch, jspwiki-528-WikiEngine.patch, jspwiki-528-WikiPage.patch, jspwiki-528-workflow.Step.patch
>
>
> Most of the APIs return Collection rather than a finer interface and in many cases these collections are repeatedly repacked and resorted unnecessarily. I will go through all APIs that return collections of pages and make them return a finer interface - probably List for unordered collections and SortedSet for ordered collections. This will make the use of these collections much clearer for further development and give us some opportunity for future optimisations.
> This is likely to be a very wide set of changes across lots of different classes so I'll submit separate patches for each class.

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


[jira] Updated: (JSPWIKI-528) Rationalise the use of Collections, particularly with regard to pages

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

Greg Kable updated JSPWIKI-528:
-------------------------------

    Attachment: jspwiki-528-ContentManager.patch

Patch 10 - jspwiki-528-ContentManager.patch

Changes to ContentManager:
- Changed getAllPages to return a List instead of a collection
- Add new API getAllPagesSorted to return a sorted result
- Add new API and getAllpages( Collection result, String space ) allowing you to use custom collections for results (e.g. a time sorted TreeSet)

Changes to PageManager
- Changed getAllPages to return a List instead of a Collection

Potential problem!!!!  When running the unit tests I saw at least one instance where the Priha content manager returned a duplicate page name in a query result.  This is only visible when using the List version of getAllPages because the Set will silently overwrite the duplicate.  Unfortunately I couldn't reliably duplicate the problem and it completely went away with the latest update.  It needs to be watched though.

Also, this is the last patch under this ticket.  It's getting too hard to track all of the patches so I don't want to do anything more until all current patches are either committed or rejected.

> Rationalise the use of Collections, particularly with regard to pages
> ---------------------------------------------------------------------
>
>                 Key: JSPWIKI-528
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-528
>             Project: JSPWiki
>          Issue Type: Improvement
>            Reporter: Greg Kable
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: jspwiki-528-AbstractFilteredPlugin.patch, jspwiki-528-AttachmentHandler.patch, jspwiki-528-ContentManager.patch, jspwiki-528-LinkCollector.patch, jspwiki-528-SearchProviders.patch, jspwiki-528-Weblog.patch, jspwiki-528-WikiEngine-771034.patch, jspwiki-528-WikiEngine.patch, jspwiki-528-WikiPage.patch, jspwiki-528-workflow.Step.patch
>
>
> Most of the APIs return Collection rather than a finer interface and in many cases these collections are repeatedly repacked and resorted unnecessarily. I will go through all APIs that return collections of pages and make them return a finer interface - probably List for unordered collections and SortedSet for ordered collections. This will make the use of these collections much clearer for further development and give us some opportunity for future optimisations.
> This is likely to be a very wide set of changes across lots of different classes so I'll submit separate patches for each class.

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


[jira] Commented: (JSPWIKI-528) Rationalise the use of Collections, particularly with regard to pages

Posted by "Andrew Jaquith (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12704627#action_12704627 ] 

Andrew Jaquith commented on JSPWIKI-528:
----------------------------------------

These are all good ideas. I haven't taken a look at the specific patches yet, but I've already (separately) fixed some of them as part of my rewrite of ReferenceManager (ongoing). In general, I favor using Lists over Collections for exactly the reason Greg cites. Thanks for taking this on.

> Rationalise the use of Collections, particularly with regard to pages
> ---------------------------------------------------------------------
>
>                 Key: JSPWIKI-528
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-528
>             Project: JSPWiki
>          Issue Type: Improvement
>            Reporter: Greg Kable
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: jspwiki-528-AttachmentHandler.patch, jspwiki-528-LinkCollector.patch, jspwiki-528-SearchProviders.patch
>
>
> Most of the APIs return Collection rather than a finer interface and in many cases these collections are repeatedly repacked and resorted unnecessarily. I will go through all APIs that return collections of pages and make them return a finer interface - probably List for unordered collections and SortedSet for ordered collections. This will make the use of these collections much clearer for further development and give us some opportunity for future optimisations.
> This is likely to be a very wide set of changes across lots of different classes so I'll submit separate patches for each class.

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


[jira] Updated: (JSPWIKI-528) Rationalise the use of Collections, particularly with regard to pages

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

Greg Kable updated JSPWIKI-528:
-------------------------------

    Attachment: jspwiki-528-Weblog.patch

Patch 5 - jspwiki-528-Weblog.patch

Changes to WeblogPlugin:
- Changed findBlogEntries to return a List instead of a Collection
- Added findBlogEntriesSorted which returns a SortedSet in reverse time order (newest first)
- Removed private class PageDateComparator and changed code to use org.apache.wiki.util.PageTimeComparator

Changes to PageTimeComparator
- Added constant DEFAULT_PAGETIME_COMPARATOR to PageTimeComparator
- Implemented PageTimeComparator.equals as requested in a FIXME comment
- Implemented hashCode

Changes to MetaWeblogHandler
- Changed to use new WeblogPlugin.findBlogEntriesSorted method

> Rationalise the use of Collections, particularly with regard to pages
> ---------------------------------------------------------------------
>
>                 Key: JSPWIKI-528
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-528
>             Project: JSPWiki
>          Issue Type: Improvement
>            Reporter: Greg Kable
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: jspwiki-528-AttachmentHandler.patch, jspwiki-528-LinkCollector.patch, jspwiki-528-SearchProviders.patch, jspwiki-528-Weblog.patch, jspwiki-528-workflow.Step.patch
>
>
> Most of the APIs return Collection rather than a finer interface and in many cases these collections are repeatedly repacked and resorted unnecessarily. I will go through all APIs that return collections of pages and make them return a finer interface - probably List for unordered collections and SortedSet for ordered collections. This will make the use of these collections much clearer for further development and give us some opportunity for future optimisations.
> This is likely to be a very wide set of changes across lots of different classes so I'll submit separate patches for each class.

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


[jira] Updated: (JSPWIKI-528) Rationalise the use of Collections, particularly with regard to pages

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

Greg Kable updated JSPWIKI-528:
-------------------------------

    Attachment: jspwiki-528-AbstractFilteredPlugin.patch

Patch 6 - jspwiki-528-AbstractFilteredPlugin.patch

Changes to AbstractFilteredPlugin:
- Changed filterCollection to return a List instead of a Collection
- Added new API filterCollectionSorted which returns a SortedSet in page name order
- Added new API filterCollection( Collection, Collection ) which allows you to get the result in an arbitrary order by passing in a custom Collection for the result.  For example, pass in a new TreeSet( DEFAULT_PAGETIME_COMPARATOR ) to get the pages in reverse time order.
- Added throw new IllegalArgumentException if the above are passed incorrect objects.
- Addedd javadoc @throws to document above behaviour
- Deprecated wikitizeCollection( Collection<String> links, String separator, int numItems ) - the separator wasn't used.
- Added  wikitizeCollection( Collection<T> links, int numItems ) which works with collections of Strings, WikiPages or WikiPaths

Changes to IndexPlugin:
- Use new filterCollectionSorted and wikitizeCollection APIs

Changes to ReferredPagesPlugin
- Use new filterCollectionSorted for the ordered list of pages

Changes to ReferringPagesPlugin
- Use new filterCollectionSorted and wikitizeCollection APIs

Changes to UndefinedPagesPlugin
- Use new filterCollectionSorted and wikitizeCollection APIs

NOTE - there are more changes here as deeper APIs get refactored but they'll be in a subsequent patch.


> Rationalise the use of Collections, particularly with regard to pages
> ---------------------------------------------------------------------
>
>                 Key: JSPWIKI-528
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-528
>             Project: JSPWiki
>          Issue Type: Improvement
>            Reporter: Greg Kable
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: jspwiki-528-AbstractFilteredPlugin.patch, jspwiki-528-AttachmentHandler.patch, jspwiki-528-LinkCollector.patch, jspwiki-528-SearchProviders.patch, jspwiki-528-Weblog.patch, jspwiki-528-workflow.Step.patch
>
>
> Most of the APIs return Collection rather than a finer interface and in many cases these collections are repeatedly repacked and resorted unnecessarily. I will go through all APIs that return collections of pages and make them return a finer interface - probably List for unordered collections and SortedSet for ordered collections. This will make the use of these collections much clearer for further development and give us some opportunity for future optimisations.
> This is likely to be a very wide set of changes across lots of different classes so I'll submit separate patches for each class.

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


[jira] Commented: (JSPWIKI-528) Rationalise the use of Collections, particularly with regard to pages

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12704754#action_12704754 ] 

Janne Jalkanen commented on JSPWIKI-528:
----------------------------------------

Three first patches included in 3.0.0-svn-107. Still keeping this open for further patches.

> Rationalise the use of Collections, particularly with regard to pages
> ---------------------------------------------------------------------
>
>                 Key: JSPWIKI-528
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-528
>             Project: JSPWiki
>          Issue Type: Improvement
>            Reporter: Greg Kable
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: jspwiki-528-AttachmentHandler.patch, jspwiki-528-LinkCollector.patch, jspwiki-528-SearchProviders.patch
>
>
> Most of the APIs return Collection rather than a finer interface and in many cases these collections are repeatedly repacked and resorted unnecessarily. I will go through all APIs that return collections of pages and make them return a finer interface - probably List for unordered collections and SortedSet for ordered collections. This will make the use of these collections much clearer for further development and give us some opportunity for future optimisations.
> This is likely to be a very wide set of changes across lots of different classes so I'll submit separate patches for each class.

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


[jira] Updated: (JSPWIKI-528) Rationalise the use of Collections, particularly with regard to pages

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

Greg Kable updated JSPWIKI-528:
-------------------------------

    Attachment: jspwiki-528-SearchProviders.patch

Patch 3 - org.apache.wiki.search.

- Changed BasicSearchProvider, LuceneSearchProvider and SearchProvider to return an ordered List and updated Javadoc to match.  Why List instead of SortedSet you ask? In this case using SortedSet would require repacking and re-ordering results from 3rd party search engines (e.g. Lucene) whereas List simply preserves the underlying order.

> Rationalise the use of Collections, particularly with regard to pages
> ---------------------------------------------------------------------
>
>                 Key: JSPWIKI-528
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-528
>             Project: JSPWiki
>          Issue Type: Improvement
>            Reporter: Greg Kable
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: jspwiki-528-AttachmentHandler.patch, jspwiki-528-LinkCollector.patch, jspwiki-528-SearchProviders.patch
>
>
> Most of the APIs return Collection rather than a finer interface and in many cases these collections are repeatedly repacked and resorted unnecessarily. I will go through all APIs that return collections of pages and make them return a finer interface - probably List for unordered collections and SortedSet for ordered collections. This will make the use of these collections much clearer for further development and give us some opportunity for future optimisations.
> This is likely to be a very wide set of changes across lots of different classes so I'll submit separate patches for each class.

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


[jira] Updated: (JSPWIKI-528) Rationalise the use of Collections, particularly with regard to pages

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

Greg Kable updated JSPWIKI-528:
-------------------------------

    Attachment: jspwiki-528-workflow.Step.patch

Patch 4 - workflow Steps.

- Changed Step and AbstractStep getAvailableOutcomes() to return Set instead of Collection
- Changed matching Tests to use Set instead of Collection

> Rationalise the use of Collections, particularly with regard to pages
> ---------------------------------------------------------------------
>
>                 Key: JSPWIKI-528
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-528
>             Project: JSPWiki
>          Issue Type: Improvement
>            Reporter: Greg Kable
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: jspwiki-528-AttachmentHandler.patch, jspwiki-528-LinkCollector.patch, jspwiki-528-SearchProviders.patch, jspwiki-528-workflow.Step.patch
>
>
> Most of the APIs return Collection rather than a finer interface and in many cases these collections are repeatedly repacked and resorted unnecessarily. I will go through all APIs that return collections of pages and make them return a finer interface - probably List for unordered collections and SortedSet for ordered collections. This will make the use of these collections much clearer for further development and give us some opportunity for future optimisations.
> This is likely to be a very wide set of changes across lots of different classes so I'll submit separate patches for each class.

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


[jira] Closed: (JSPWIKI-528) Rationalise the use of Collections, particularly with regard to pages

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

Harry Metske closed JSPWIKI-528.
--------------------------------

    Resolution: Fixed

thanks Greg and Andrew, closing...

> Rationalise the use of Collections, particularly with regard to pages
> ---------------------------------------------------------------------
>
>                 Key: JSPWIKI-528
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-528
>             Project: JSPWiki
>          Issue Type: Improvement
>            Reporter: Greg Kable
>            Assignee: Andrew Jaquith
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: jspwiki-528-AbstractFilteredPlugin.patch, jspwiki-528-AttachmentHandler.patch, jspwiki-528-ContentManager.patch, jspwiki-528-LinkCollector.patch, jspwiki-528-SearchProviders.patch, jspwiki-528-Weblog.patch, jspwiki-528-WikiEngine-771034.patch, jspwiki-528-WikiEngine.patch, jspwiki-528-WikiPage.patch, jspwiki-528-workflow.Step.patch
>
>
> Most of the APIs return Collection rather than a finer interface and in many cases these collections are repeatedly repacked and resorted unnecessarily. I will go through all APIs that return collections of pages and make them return a finer interface - probably List for unordered collections and SortedSet for ordered collections. This will make the use of these collections much clearer for further development and give us some opportunity for future optimisations.
> This is likely to be a very wide set of changes across lots of different classes so I'll submit separate patches for each class.

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


[jira] Updated: (JSPWIKI-528) Rationalise the use of Collections, particularly with regard to pages

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

Greg Kable updated JSPWIKI-528:
-------------------------------

    Attachment: jspwiki-528-WikiEngine-771034.patch

Patch 9 - jspwiki-528-WikiEngine-771034.patch

Reapplies the changes to WikiEngine after the latest update.

The latest update also introduced conflicts between with the jspwiki-528-WikiPage.patch in ReferenceManager.java and JCRWikiPage.java.  I've looked at those conflicts and my patches can be skipped.



> Rationalise the use of Collections, particularly with regard to pages
> ---------------------------------------------------------------------
>
>                 Key: JSPWIKI-528
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-528
>             Project: JSPWiki
>          Issue Type: Improvement
>            Reporter: Greg Kable
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: jspwiki-528-AbstractFilteredPlugin.patch, jspwiki-528-AttachmentHandler.patch, jspwiki-528-LinkCollector.patch, jspwiki-528-SearchProviders.patch, jspwiki-528-Weblog.patch, jspwiki-528-WikiEngine-771034.patch, jspwiki-528-WikiEngine.patch, jspwiki-528-WikiPage.patch, jspwiki-528-workflow.Step.patch
>
>
> Most of the APIs return Collection rather than a finer interface and in many cases these collections are repeatedly repacked and resorted unnecessarily. I will go through all APIs that return collections of pages and make them return a finer interface - probably List for unordered collections and SortedSet for ordered collections. This will make the use of these collections much clearer for further development and give us some opportunity for future optimisations.
> This is likely to be a very wide set of changes across lots of different classes so I'll submit separate patches for each class.

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