Closed
Bug 48783
Opened 26 years ago
Closed 24 years ago
nsSupportsArray's nsICollection implementation breaks XPCOM rules.
Categories
(Core :: XPCOM, defect, P3)
Tracking
()
RESOLVED
WONTFIX
Future
People
(Reporter: jud, Assigned: dougt)
Details
(Keywords: helpwanted, topembed-, Whiteboard: [nsbeta3-])
nsSupportsArray says it implements nsISupportsArray (which inherits from
nsICollection). nsICollection says it's an xpcom iterface and returns an
nsresult for AppendElement (and RemoveElement). However,
nsSupportsArray's implementation of nsICollection is not returning valid
nsresults (see
http://lxr.mozilla.org/seamonkey/source/xpcom/ds/nsSupportsArray.h#58).
Instead it's returning the opposite of what it should be returning (it's
returning a bool which is reversed in com). If you checked the retval of
AppendElement for NS_OK you'd fail, even though AppendElement succeeded.
Comment 1•26 years ago
|
||
When this is fixed, the following needs to be changed accordingly:
http://lxr.mozilla.org/seamonkey/source/xpcom/io/nsDirectoryService.cpp#626
Comment 3•26 years ago
|
||
It would be helpful if the reporter knows of a simple test that could be used to
verify the fix.
Comment 4•26 years ago
|
||
It's an API problem. It's defined to be returning 0 when it should be returning
1 and vice versa. To test it, just call the method and see if you get the right
result. The change is a one-line change to the method (see the method above it),
but callers may need to be updated as well.
Comment 5•26 years ago
|
||
I asked the question, because it seemed that this information would be quite
obvious to whoever filed the bug report who understood the codependance and that
the original function was working, and would make a silly mistake less likely.
It is not a one-line change. The corresponding change also needs to be made to
the code which calls it. The change is easy, but could also be screwed up by
misinterpreting a compiler interpretation.
The question is, what observable function of Netscape fails if these
co-dependent changes are incorrectly done at some level. Or I will spend a
while figuring it out myself so I can reasonably test. I just thought that the
person who understood the problem in its original context could save me a few
minutes, but it is taking way too much time to explain a simple request for
basic bug information about how to test the bug and the fix. Especially with
codependent changes, it is usually best to test them together and know what
behavior of Netscape could be compromised.
Comment 6•26 years ago
|
||
I know this is a dup, but I can't find the original.
And yeah, this API problem is heinous -- I often forget that
AppendElement/RemoveElement (and friends) return the wrong thing, and find out
later when it fails.
Comment 7•26 years ago
|
||
The word "often" leads me to believe that there are a number of places to be
fixed. I will hunt for them.
Comment 8•26 years ago
|
||
I have made this nsbeta3+, because it seems that this is a critical API change
that cannot wait until later.
Keywords: nsbeta3
Whiteboard: [nsbeta3+]
Updated•26 years ago
|
Status: NEW → ASSIGNED
Updated•26 years ago
|
Target Milestone: --- → M18
Comment 11•26 years ago
|
||
Assigning rest of xpcom stuff to myself (from Ray).
Assignee: rayw → warren
Status: ASSIGNED → NEW
Target Milestone: M18 → mozilla1.0
Comment 12•25 years ago
|
||
reasigning warren bugs to default component owners.
Assignee: warren → kandrot
QA Contact: rayw → scc
Target Milestone: mozilla1.0 → ---
| Assignee | ||
Comment 14•25 years ago
|
||
this interface is not going to be exposed.
Target Milestone: --- → Future
| Assignee | ||
Comment 15•24 years ago
|
||
This is not part of the XPCOM SDK and therefore should not be a top embed bug.
No longer blocks: 98278
| Reporter | ||
Updated•24 years ago
|
Comment 16•24 years ago
|
||
Dup of bug 130544?
Comment 17•24 years ago
|
||
wont fix
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•