public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Daney <ddaney@avtrex.com>
To: Andrew John Hughes <gnu_andrew@member.fsf.org>
Cc: java <java@gcc.gnu.org>
Subject: Re: Build failure with the 0.98 merge
Date: Thu, 21 Aug 2008 17:32:00 -0000	[thread overview]
Message-ID: <48ADA678.1020004@avtrex.com> (raw)
In-Reply-To: <48AD9DCC.8040302@avtrex.com>

David Daney wrote:
> Andrew John Hughes wrote:
>> Hi all,
>>
>> I'm getting a build error when trying to compile the version of GCJ
>> merged with Classpath 0.98:
>>
>> In file included from
>> /home/andrew/projects/classpath/gcj/sources/gcc/libjava/interpret.cc:25:
>> /home/andrew/projects/classpath/gcj/sources/gcc/libjava/java/lang/StringBuffer.h:97: 
>>
>> error: 'java::lang::AbstractStringBuffer*
>> java::lang::StringBuffer::StringBuffer$append(jchar)' cannot be
>> overloaded
>> /home/andrew/projects/classpath/gcj/sources/gcc/libjava/java/lang/StringBuffer.h:38: 
>>
>> error: with 'virtual java::lang::StringBuffer*
>> java::lang::StringBuffer::StringBuffer$append(jchar)'
>> /home/andrew/projects/classpath/gcj/sources/gcc/libjava/java/lang/StringBuffer.h:100: 
>>
>> error: 'java::lang::AbstractStringBuffer*
>> java::lang::StringBuffer::StringBuffer$append(java::lang::CharSequence*,
>> jint, jint)' cannot be overloaded
>> /home/andrew/projects/classpath/gcj/sources/gcc/libjava/java/lang/StringBuffer.h:36: 
>>
>> error: with 'java::lang::StringBuffer*
>> java::lang::StringBuffer::StringBuffer$append(java::lang::CharSequence*,
>> jint, jint)'
>> /home/andrew/projects/classpath/gcj/sources/gcc/libjava/java/lang/StringBuffer.h:102: 
>>
>> error: 'java::lang::AbstractStringBuffer*
>> java::lang::StringBuffer::StringBuffer$append(java::lang::CharSequence*)'
>> cannot be overloaded
>> /home/andrew/projects/classpath/gcj/sources/gcc/libjava/java/lang/StringBuffer.h:35: 
>>
>> error: with 'java::lang::StringBuffer*
>> java::lang::StringBuffer::StringBuffer$append(java::lang::CharSequence*)'
>> make[3]: *** [interpret.lo] Error 1
>>
>> Is there an issue with gcj and the use of covariant return types from 
>> 1.5?
>>
>> The methods in question are StringBuffer.append(char),
>> StringBuffer.append(CharSequence,int,int) and
>> StringBuffer.append(CharSequence). All return a StirngBuffer and
>> override methods with the same signature but a return type of
>> AbstractStringBuffer in AbstractStringBuffer.
> 
>  From #gcj:
> 
> (09:49:57 AM) daney: You could keep the common code factored out, but 
> just use different names for the methods.  Because the java code has to 
> return the correct type and synchronize, there have to be little stub 
> methods in the child class that return super.method().  Since we already 
> have to have these little stubs, they might as well return 
> super.otherMethod()
> 
> (09:50:40 AM) tromey: yeah
> 
> (09:50:44 AM) daney: That way the public methods would not have to 
> override anything.

More Ideas...


(09:57:21 AM) tromey: ISTR some special code in the new gcjh for this stuff
(09:57:22 AM) tromey: hmm
(10:02:45 AM) daney: Any overridden method is declared to return the same type as the base class method?
(10:03:19 AM) daney: Something like that might work.
(10:04:14 AM) daney: I don't know if you would have to do anything for interfaces.
(10:04:50 AM) tromey: I'd have to look it up
(10:05:01 AM) tromey: whatever I did here required a lot of thought
(10:05:13 AM) tromey: to ensure myself that it was correct
(10:06:19 AM) daney: When building with -enable-java-maintainer-mode we use the system gjavah and not the one from the code being built, don't we?
(10:06:51 AM) tromey: yeah
(10:06:57 AM) tromey: I think so
(10:06:58 AM) daney: I wonder if that is his problem.





  reply	other threads:[~2008-08-21 17:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-20 20:53 Andrew John Hughes
2008-08-21  9:31 ` Andrew Haley
2008-08-21 14:22   ` Andrew John Hughes
2008-08-21 16:55 ` David Daney
2008-08-21 17:32   ` David Daney [this message]
2008-08-21 18:50 ` Tom Tromey
2008-09-02 20:56   ` Andrew John Hughes
2008-09-02 21:00     ` David Daney
2008-09-03  0:01       ` Andrew John Hughes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48ADA678.1020004@avtrex.com \
    --to=ddaney@avtrex.com \
    --cc=gnu_andrew@member.fsf.org \
    --cc=java@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).