1) The default template has a piece of JavaScript which pops up a list
of matching pages as you type a link but the list is unordered.  I'd
like to order it but I can't figure out where it's getting the list. Does anybody know?

SearchManager.JSONSearch.getSuggestions().

2) I've noticed lot's of cases where page lists are repacked and
resorted multiple times because the APIs return only Collection so the developer has played it safe and repacked into something they know. Before I port the sorting patch, I'd like to go through all APIs that return collections of pages and make them return a standard, concrete class - HashSet for unordered collections, TreeSet for ordered collections. The big disadvantage of doing this is that we can no longer change the Collection used by the APIs - they are now frozen. Two big advantages are a much clearer understanding of what's going on and some opportunity to optimise behaviour because we know and can rely on the underlying implementation. It will also give me a chance to get familiar with 3.x. Any opinions?

Yup, this is fine for 3.0. We've tagged a bunch of APIs with FIXMEs concerning this exact same problem, and some of the APIs have already been changed to reflect the contents.

I recommend you open a new JIRA issue and add a patch there.

Though please, do use SortedSet for ordered collections and Set for unordered. It's better to return interfaces than concrete classes - that's what they're for! Relying on the underlying implementation is bad, because that prevents us from ever changing them. Returning a Collection is probably overkill for quite a few APIs, though.

/Janne

Reply via email to