Closed Bug 273357 Opened 21 years ago Closed 21 years ago

[extension/java/xpcom] query interface does not discover interface

Categories

(Core Graveyard :: Java to XPCOM Bridge, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: michal.ceresna, Assigned: jhpedemonte)

Details

Attachments

(1 file, 2 obsolete files)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041119 Firefox/1.0 (Debian package 1.0-3) Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041119 Firefox/1.0 (Debian package 1.0-3) This applies to the code in extenstion/java/xpcom lets have a java-xpcom object implemeted by nsIDOMHTMLButtonElement_Stub. The corresponding idl hierarchy is: nsIDOMHTMLButtonElement -> nsIDOMHTMLElement -> nsIDOMNode -> nsISupports then according to the code in XPCOM.queryInterface QI to nsIDOMHTMLElement works, but QI to nsIDOMNode does not because the Class.getInterfaces() returns only parent interfaces and not all ancestors Moreover, sometimes I've observed that the aIID parameter to the XPCOM.queryInterface has the '{' prefix and '}' suffix Reproducible: Always Steps to Reproduce: 1. 2. 3.
Attached patch proposed fix (obsolete) — Splinter Review
Attached patch proposed fix (obsolete) — Splinter Review
Newer patch from bug 275359.
Attachment #168009 - Attachment is obsolete: true
Status: UNCONFIRMED → NEW
Ever confirmed: true
Status: NEW → ASSIGNED
Attached patch patchSplinter Review
This is the patch I put together. The only major difference from your patch is that I remove the ArrayList elements starting from the front; this should speed up the common case, where QI asks for one of the directly implemented interfaces. I also removed the code dealign with the brackets in the IID string. The string representation of an IID (nsID->ToString()) contains opening and closing brackets. The only problem I have with the loop is that the first run through the loop will try to get the IID for given object, which is unnecessary. We should just start with its interfaces and superclass, and go from there. Haven't found a nice way to code that yet.
Attachment #169399 - Attachment is obsolete: true
Patch checked into trunk. -> FIXED
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: