public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch, 4.3 branch] Fix naming of bridge targets in gjavah
@ 2008-09-14 18:23 Matthias Klose
  0 siblings, 0 replies; only message in thread
From: Matthias Klose @ 2008-09-14 18:23 UTC (permalink / raw)
  To: GCJ-patches

[-- Attachment #1: Type: text/plain, Size: 322 bytes --]

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

[-- Attachment #2: javah.diff --]
[-- Type: text/plain, Size: 1848 bytes --]

classpath/ChangeLog.gcj

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.

 
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);



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-09-14 18:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-14 18:23 [patch, 4.3 branch] Fix naming of bridge targets in gjavah Matthias Klose

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).