From 80d06f079e4948de27134c3f2f5010ce3b366296 Mon Sep 17 00:00:00 2001 From: "sdv%sparc.spb.su" Date: Fri, 6 Oct 2000 15:04:05 +0000 Subject: [PATCH] * NOT PART OF TBOX BUILD * fix for bug=55353 git-svn-id: svn://10.0.0.236/trunk@80579 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/java/xpcom/java/classes/makefile.win | 1 + .../org/mozilla/xpcom/InterfaceRegistry.java | 20 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/mozilla/java/xpcom/java/classes/makefile.win b/mozilla/java/xpcom/java/classes/makefile.win index f409fb67e04..55835ffa401 100644 --- a/mozilla/java/xpcom/java/classes/makefile.win +++ b/mozilla/java/xpcom/java/classes/makefile.win @@ -37,3 +37,4 @@ JAVAC_PROG=$(JDKHOME)\bin\javac JAVAC_FLAGS=-classpath "$(CLASSPATH);$(JAVA_DESTPATH)" -d "$(JAVA_DESTPATH)" include <$(DEPTH)\config\rules.mak> +include <$(DEPTH)\config\javarules.mak> diff --git a/mozilla/java/xpcom/java/classes/org/mozilla/xpcom/InterfaceRegistry.java b/mozilla/java/xpcom/java/classes/org/mozilla/xpcom/InterfaceRegistry.java index a8c29435081..b63585bd88c 100644 --- a/mozilla/java/xpcom/java/classes/org/mozilla/xpcom/InterfaceRegistry.java +++ b/mozilla/java/xpcom/java/classes/org/mozilla/xpcom/InterfaceRegistry.java @@ -71,24 +71,22 @@ public class InterfaceRegistry { String[] methodNames = Utilities.getInterfaceMethodNames((String)iidStr); if (methodNames != null) { Method[] rmethods = new Method[methodNames.length]; - int i = methodNames.length - 1; Class[] ifaces = new Class[]{cl}; - // recursively get all parent interface methods + Hashtable mhash = new Hashtable(methodNames.length); + // recursively get all parent interface methods do { Method[] methods = ifaces[0].getDeclaredMethods(); - int j = methods.length - 1; - while (i >= 0 && j >=0) { - if (methodNames[i].equals(methods[j].getName())) { - rmethods[i--] = methods[j--]; - } else { - // put null for notxpcom & noscript methods - rmethods[i--] = null; - } - } + for (int i = 0; i < methods.length; i++) { + mhash.put(methods[i].getName(), methods[i]); + } ifaces = ifaces[0].getInterfaces(); // check for single inheritance (xpcom) } while (ifaces.length == 1); + for (int j = methodNames.length - 1; j >= 0; j--) { + rmethods[j] = (Method)mhash.get(methodNames[j]); + } + interfaces.put(iid, cl); iMethods.put(iid, new MethodArray(rmethods));