From e31cfbb6ebcdb01d27fa72c76de506aee75d90d6 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Fri, 29 Jun 2007 00:14:56 +0000 Subject: Fixed bug in handling of package-private native methods called through procedure addresses git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@65 a78bb65f-1512-4460-ba86-f6dc96a7bf27 --- .../com/sun/gluegen/procaddress/ProcAddressEmitter.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/java/com/sun/gluegen') diff --git a/src/java/com/sun/gluegen/procaddress/ProcAddressEmitter.java b/src/java/com/sun/gluegen/procaddress/ProcAddressEmitter.java index 397f157..fe77248 100755 --- a/src/java/com/sun/gluegen/procaddress/ProcAddressEmitter.java +++ b/src/java/com/sun/gluegen/procaddress/ProcAddressEmitter.java @@ -197,11 +197,17 @@ public class ProcAddressEmitter extends JavaEmitter this); emitters.add(emitter); - // If this emitter doesn't have a body (i.e., is a public native - // call), we need to force it to emit a body, and produce another - // one to act as the entry point + // If this emitter doesn't have a body (i.e., is a direct native + // call with no intervening argument processing), we need to force + // it to emit a body, and produce another one to act as the entry + // point + // FIXME: the negative test against the PRIVATE modifier is a + // nasty hack to prevent the ProcAddressJavaMethodBindingEmitter + // from incorrectly introducing method bodies to the private + // native implementing methods; want this to work at least for + // public and package-private methods if (baseJavaEmitter.signatureOnly() && - baseJavaEmitter.hasModifier(JavaMethodBindingEmitter.PUBLIC) && + !baseJavaEmitter.hasModifier(JavaMethodBindingEmitter.PRIVATE) && baseJavaEmitter.hasModifier(JavaMethodBindingEmitter.NATIVE) && callThroughProcAddress) { emitter.setEmitBody(true); -- cgit v1.2.3