public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/15133] New: gcjh generates wrong method signatures
@ 2004-04-25 15:42 konqueror at gmx dot de
  2004-04-25 15:43 ` [Bug java/15133] " konqueror at gmx dot de
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: konqueror at gmx dot de @ 2004-04-25 15:42 UTC (permalink / raw)
  To: java-prs

gcjh generates wrong method signatures for overloaded native methods. I have 
found two instances of it in GNU classpath: 
 
In gnu.java.net.PlainSocketImpl: 
 
extern JNIEXPORT void JNICALL 
Java_gnu_java_net_PlainSocketImpl_connect__Ljava_net_InetAddress_2I (JNIEnv 
*env, jobject, jobject, jint); 
 
should be: 
 
extern JNIEXPORT void JNICALL 
Java_gnu_java_net_PlainSocketImpl_connect(JNIEnv*, jobject, jobject, jint); 
 
In java.nio.DirectByteBufferImpl: 
 
extern JNIEXPORT void JNICALL 
Java_java_nio_DirectByteBufferImpl_shiftDown__Lgnu_classpath_RawData_2III 
(JNIEnv *env, jclass, jobject, jint, jint, jint); 
 
should be: 
 
extern JNIEXPORT void JNICALL Java_java_nio_DirectByteBufferImpl_shiftDown 
(JNIEnv *env, jclass, jobject, jint, jint, jint); 
 
This only happens with overloaded methods. When I rename the native methods to 
some name that doesnt exist in this class yet it works.

-- 
           Summary: gcjh generates wrong method signatures
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: konqueror at gmx dot de
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15133


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug java/15133] gcjh generates wrong method signatures
  2004-04-25 15:42 [Bug java/15133] New: gcjh generates wrong method signatures konqueror at gmx dot de
@ 2004-04-25 15:43 ` konqueror at gmx dot de
  2004-04-25 15:54 ` konqueror at gmx dot de
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: konqueror at gmx dot de @ 2004-04-25 15:43 UTC (permalink / raw)
  To: java-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |konqueror at gmx dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15133


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug java/15133] gcjh generates wrong method signatures
  2004-04-25 15:42 [Bug java/15133] New: gcjh generates wrong method signatures konqueror at gmx dot de
  2004-04-25 15:43 ` [Bug java/15133] " konqueror at gmx dot de
@ 2004-04-25 15:54 ` konqueror at gmx dot de
  2004-04-25 16:33 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: konqueror at gmx dot de @ 2004-04-25 15:54 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From konqueror at gmx dot de  2004-04-25 15:54 -------
Here is a little testcase: 
 
public class JNITest 
{ 
  public void test (String message) 
  { 
  } 
 
  public native void test (int number); 
} 
 
With javah from SUN JDK 1.4.2 I get the signature: 
 
JNIEXPORT void JNICALL Java_JNITest_test (JNIEnv *env, jobject, jint); 
 
With gcjh I get: 
 
JNIEXPORT void JNICALL Java_JNITest_test__I (JNIEnv *env, jobject, jint); 
 
 
This happens with gcjh 3.5.0 and 3.3.3. 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15133


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug java/15133] gcjh generates wrong method signatures
  2004-04-25 15:42 [Bug java/15133] New: gcjh generates wrong method signatures konqueror at gmx dot de
  2004-04-25 15:43 ` [Bug java/15133] " konqueror at gmx dot de
  2004-04-25 15:54 ` konqueror at gmx dot de
@ 2004-04-25 16:33 ` pinskia at gcc dot gnu dot org
  2004-04-27 10:25 ` rmathew at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-25 16:33 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-25 16:33 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
      Known to fail|                            |3.0.4 3.2.3 3.3.1 3.3.3
                   |                            |3.4.0 3.5.0
   Last reconfirmed|0000-00-00 00:00:00         |2004-04-25 16:33:56
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15133


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug java/15133] gcjh generates wrong method signatures
  2004-04-25 15:42 [Bug java/15133] New: gcjh generates wrong method signatures konqueror at gmx dot de
                   ` (2 preceding siblings ...)
  2004-04-25 16:33 ` pinskia at gcc dot gnu dot org
@ 2004-04-27 10:25 ` rmathew at gcc dot gnu dot org
  2004-04-27 11:52 ` rmathew at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rmathew at gcc dot gnu dot org @ 2004-04-27 10:25 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From rmathew at gcc dot gnu dot org  2004-04-27 10:25 -------
The problem is that disambiguation using arguments should only happen
for *native* overloaded methods - in this case, even a non-native
method triggers the disambiguation logic.

More specifically, in gjavah.c we should also keep track of 
whether a method seen before was native and use this information in
overloaded_jni_method_exists_p().

I have a patch for this which I will submit shortly, assuming it
passes all tests - it certainly resolves this particular testcase
and also behaves correctly when more overloaded native methods
are present.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15133


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug java/15133] gcjh generates wrong method signatures
  2004-04-25 15:42 [Bug java/15133] New: gcjh generates wrong method signatures konqueror at gmx dot de
                   ` (3 preceding siblings ...)
  2004-04-27 10:25 ` rmathew at gcc dot gnu dot org
@ 2004-04-27 11:52 ` rmathew at gcc dot gnu dot org
  2004-04-30 18:14 ` cvs-commit at gcc dot gnu dot org
  2004-04-30 18:57 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: rmathew at gcc dot gnu dot org @ 2004-04-27 11:52 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From rmathew at gcc dot gnu dot org  2004-04-27 11:52 -------
The patch is here:

http://gcc.gnu.org/ml/java-patches/2004-q2/msg00242.html

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15133


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug java/15133] gcjh generates wrong method signatures
  2004-04-25 15:42 [Bug java/15133] New: gcjh generates wrong method signatures konqueror at gmx dot de
                   ` (4 preceding siblings ...)
  2004-04-27 11:52 ` rmathew at gcc dot gnu dot org
@ 2004-04-30 18:14 ` cvs-commit at gcc dot gnu dot org
  2004-04-30 18:57 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-04-30 18:14 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-04-30 18:14 -------
Subject: Bug 15133

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	rmathew@gcc.gnu.org	2004-04-30 18:14:08

Modified files:
	gcc/java       : ChangeLog gjavah.c 

Log message:
	Fixes PR java/15133
	* gjavah.c (struct method_name): Add member is_native.
	(overloaded_jni_method_exists_p): Match candidate method only if
	it is native.
	(print_method_info): Initialise is_native flag from the method's
	access flags.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&r1=1.1358&r2=1.1359
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/gjavah.c.diff?cvsroot=gcc&r1=1.113&r2=1.114



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15133


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug java/15133] gcjh generates wrong method signatures
  2004-04-25 15:42 [Bug java/15133] New: gcjh generates wrong method signatures konqueror at gmx dot de
                   ` (5 preceding siblings ...)
  2004-04-30 18:14 ` cvs-commit at gcc dot gnu dot org
@ 2004-04-30 18:57 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-30 18:57 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-30 18:57 -------
Fixed for 3.5.0.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |3.5.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15133


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-04-30 18:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-25 15:42 [Bug java/15133] New: gcjh generates wrong method signatures konqueror at gmx dot de
2004-04-25 15:43 ` [Bug java/15133] " konqueror at gmx dot de
2004-04-25 15:54 ` konqueror at gmx dot de
2004-04-25 16:33 ` pinskia at gcc dot gnu dot org
2004-04-27 10:25 ` rmathew at gcc dot gnu dot org
2004-04-27 11:52 ` rmathew at gcc dot gnu dot org
2004-04-30 18:14 ` cvs-commit at gcc dot gnu dot org
2004-04-30 18:57 ` pinskia at gcc dot gnu dot org

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