Closed
Bug 87884
Opened 24 years ago
Closed 14 years ago
nsPrefBranch::GetChildList should return an error if there are no children
Categories
(Core :: Preferences: Backend, defect)
Core
Preferences: Backend
Tracking
()
RESOLVED
WONTFIX
Future
People
(Reporter: mkaply, Unassigned)
Details
(Keywords: topembed-)
See bug 82632.
Here is the relevant conversation
------- Additional Comments From Alec Flett 2001-05-25 09:37 -------
so actually, I think this should be returning NS_ERROR_FAILURE or something
related if there are no child prefs - that will match the behavior of
getIntPref()/etc when the requested pref does not exist.
------- Additional Comments From Brian Nesse 2001-05-30 15:54 -------
Neither of the methods that GetChildList replaces, EnumerateChildren or
CreateChildList, throws an error in this situation. EnumerateChildren (which I
believe Mitch was using before) simply wouldn't have called the callback
routine. CreateChildList would have created an empty 2k buffer and returned it.
In either case NS_OK was the return value.
If you want to change it, that's fine, but there may be complications...
------- Additional Comments From Alec Flett 2001-05-30 17:12 -------
lxr is your friend.. find all the consumers and make sure they behave correctly
given the new semantics..this isn't an opaque codebase :)
besides, if we look at each case:
- EnumerateChildren: old behavior would be to simply never call the callback,
but return success instead. Looking in LXR (
http://lxr.mozilla.org/seamonkey/search?string=-%3EEnumerateChildren ) I notice
that only 4 uses of EnumerateChildren actually makes use of the return value and
in every case, they just propagate the error/success to their caller - since
they always return NS_OK, we can just propagate NS_OK in those 4 incidents.
- CreateChildList: There are only 4 uses of this, and each one just has an if()
around it.. you just get rid of the if, and then nothing will change.
So there, there are NO complications if we fix these 8 lines of code.
Updated•23 years ago
|
Target Milestone: --- → mozilla1.0
Updated•23 years ago
|
Updated•16 years ago
|
Assignee: bnesse → nobody
QA Contact: bugzilla → preferences-backend
Reporter | ||
Comment 2•14 years ago
|
||
It's been this way for 10 years and will stay this way.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•