From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20555 invoked by alias); 14 Sep 2008 18:19:53 -0000 Received: (qmail 20542 invoked by uid 22791); 14 Sep 2008 18:19:52 -0000 X-Spam-Check-By: sourceware.org Received: from adelie.canonical.com (HELO adelie.canonical.com) (91.189.90.139) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 14 Sep 2008 18:19:03 +0000 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.60 #1 (Debian)) id 1KewBY-0006oX-Tv for ; Sun, 14 Sep 2008 19:19:00 +0100 Received: from dslb-088-074-011-113.pools.arcor-ip.net ([88.74.11.113] helo=[192.168.42.17]) by hutte.canonical.com with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KewBY-0005be-MX for java-patches@gcc.gnu.org; Sun, 14 Sep 2008 19:19:00 +0100 Message-ID: <48CD55A7.7080804@ubuntu.com> Date: Sun, 14 Sep 2008 18:23:00 -0000 From: Matthias Klose User-Agent: Thunderbird 2.0.0.16 (X11/20080724) MIME-Version: 1.0 To: GCJ-patches Subject: [patch, 4.3 branch] Fix naming of bridge targets in gjavah Content-Type: multipart/mixed; boundary="------------040603050307060003080309" X-IsSubscribed: yes Mailing-List: contact java-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-patches-owner@gcc.gnu.org X-SW-Source: 2008-q3/txt/msg00091.txt.bz2 This is a multi-part message in MIME format. --------------040603050307060003080309 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Content-length: 322 For the classpath checkin see http://developer.classpath.org/pipermail/classpath-patches/2008-September/006249.html Checked in on the classpath-0.98 merge branch (this contains the fixes for the header files as well): http://gcc.gnu.org/ml/java-patches/2008-q3/msg00080.html Approved by Andrew Haley on irc. Matthias --------------040603050307060003080309 Content-Type: text/plain; name="javah.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="javah.diff" Content-length: 1848 classpath/ChangeLog.gcj 2008-09-14 Matthias Klose Merge from classpath: 2008-09-02 Andrew John Hughes * tools/gnu/classpath/tools/javah/ClassWrapper.java: (makeVtable()): Populate methodNameMap. (printMethods(CniPrintStream)): Always use pre-populated methodNameMap for bridge targets. * tools/classes/gnu/classpath/tools/javah/ClassWrapper.class: Update. Index: classpath/tools/gnu/classpath/tools/javah/ClassWrapper.java =================================================================== --- classpath/tools/gnu/classpath/tools/javah/ClassWrapper.java (revision 140358) +++ classpath/tools/gnu/classpath/tools/javah/ClassWrapper.java (working copy) @@ -217,7 +217,18 @@ MethodNode m = (MethodNode) i.next(); String desc = MethodHelper.getBridgeTarget(m); if (desc != null) - bridgeTargets.add(m.name + desc); + { + String sum = m.name + desc; + boolean newTarget = bridgeTargets.add(sum); + if (newTarget) + { + // Bridge target that is new in this class. + String cname = this.name; + int index = cname.lastIndexOf('/'); + cname = cname.substring(index + 1); + methodNameMap.put(sum, cname + "$" + m.name); + } + } } } @@ -247,18 +258,7 @@ String nameToUse; String sum = m.name + m.desc; if (bridgeTargets.contains(sum)) - { - if (methodNameMap.containsKey(sum)) - nameToUse = (String) methodNameMap.get(sum); - else - { - // Bridge target that is new in this class. - String cname = this.name; - int index = cname.lastIndexOf('/'); - cname = cname.substring(index + 1); - nameToUse = cname + "$" + m.name; - } - } + nameToUse = (String) methodNameMap.get(sum); else nameToUse = Keywords.getCxxName(m.name); methodNameMap.put(sum, nameToUse); --------------040603050307060003080309--