This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: define-simple-class + non-default constructor = invalid Java class created
- From: Per Bothner <per at bothner dot com>
- To: Vladimir Tsichevski <tsichevski at gmail dot com>
- Cc: kawa at sourceware dot org
- Date: Mon, 05 Nov 2012 16:52:51 -0800
- Subject: Re: define-simple-class + non-default constructor = invalid Java class created
- References: <509831B8.1090207@gmail.com>
On 11/05/2012 01:38 PM, Vladimir Tsichevski wrote:
Hi,
compiling this [define-simple-class with non-default constructor]
...
results in the class with bad non-default constructor (output created
with jd-decompiler):
public class Test
{
private Long id;
private String firstName;
public Test(Long arg1, String arg2)
{
String fn;
this.id = nid;
this.firstName = fn;
}
}
I'm a bit confused. This output suggests you compiled Test
*not* in Test.scm, hence a separate module-class. When I do that,
the generated bytecode looks fine to me. I haven't tried
jd-decompiler since I couldn't see a simple way to download it
(as a standalone command-line application).
I would guess a limitation/bug in jd-decompiler. Note it is
not a goal of Kawa to produce bytecode than can be easily decompiled.
(It is not a goal to do the opposite either.)
When I compile with the source in file Test.scm, I get a Kawa compiler
crash. Ooops. I checked in a fix for that crash. If after you still have
problems, send me the output from gnu.bytecode.dump on Test.class.
--
--Per Bothner
per@bothner.com http://per.bothner.com/