Closed
Bug 297315
Opened 19 years ago
Closed 19 years ago
Sort nsICategoryManager.enumerateCategory alphabetically
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla1.8beta3
People
(Reporter: benjamin, Assigned: benjamin)
References
Details
Attachments
(1 file)
9.75 KB,
patch
|
darin.moz
:
review+
asa
:
approval-aviary1.1a2+
|
Details | Diff | Splinter Review |
I have found myself several times sorting the results of nsICategoryManager.enumerateCategory alphabetically in client code. It is very simple to do this before handing out the enumerator, and a lot harder afterwards.
Assignee | ||
Comment 1•19 years ago
|
||
Assignee | ||
Updated•19 years ago
|
Attachment #185857 -
Flags: review?(darin)
Comment 2•19 years ago
|
||
Comment on attachment 185857 [details] [diff] [review] Sort enumerateCategory() and remove some manual sorting code, rev. 1 Please add documentation to nsICategoryManager.idl
Attachment #185857 -
Flags: review?(darin) → review+
Comment 3•19 years ago
|
||
darin, we discussed this over irc. no changes should be made to the IDL as it is frozen and any any mention of ordering will either violate the origanal contract or assert the behavior of some implementation.
Comment 4•19 years ago
|
||
Then perhaps the IDL should state clearly that the ordering is not specified. Otherwise, someone might look at the implementation and make the false assumption that the result is always sorted.
Comment 5•19 years ago
|
||
good idea.
Comment 6•19 years ago
|
||
Of course, it also means that our own code would be violating that comment :-/ Maybe somehow comment that in Gecko 1.8 and later, the nsICategoryManager implemented by XPCOM returns sorted results?
Assignee | ||
Comment 7•19 years ago
|
||
Isn't that exactly what my change to nsXPCOMCID.h does?
Assignee | ||
Updated•19 years ago
|
Attachment #185857 -
Flags: approval-aviary1.1a2?
Updated•19 years ago
|
Attachment #185857 -
Flags: approval-aviary1.1a2? → approval-aviary1.1a2+
Comment 8•19 years ago
|
||
Yes, it does. But, nsICategoryManager itself doesn't specify or not specify. It should probably say something. Maybe say that sorting behavior is implementation specific (e.g., see nsXPCOMCID.h for information about the XPCOM category manager implementation).
Assignee | ||
Comment 9•19 years ago
|
||
Fixed on trunk. There was an error in nsCommandLine.cpp (rv = NS_ERROR_ABORT instead of rv == NS_ERROR_ABORT) which is now also fixed.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.8beta3
You need to log in
before you can comment on or make changes to this bug.
Description
•