backport: 2008-09-02 Andrew John Hughes <gnu_andrew at member.fsf.org>

2008-09-14  Matthias Klose  <doko@ubuntu.com>

        Merge from classpath:
        2008-09-02  Andrew John Hughes  <gnu_andrew at member.fsf.org>

        * 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.

From-SVN: r140365
This commit is contained in:
Matthias Klose 2008-09-14 18:27:33 +00:00 committed by Matthias Klose
parent 20232db8e9
commit 6ed81f610b
3 changed files with 25 additions and 13 deletions

View File

@ -1,3 +1,15 @@
2008-09-14 Matthias Klose <doko@ubuntu.com>
Merge from classpath:
2008-09-02 Andrew John Hughes <gnu_andrew at member.fsf.org>
* 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.
2008-04-17 Tom Tromey <tromey@redhat.com>
PR libgcj/35950:

View File

@ -217,7 +217,18 @@ public class ClassWrapper
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 @@ public class ClassWrapper
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);