java.lang.reflect.Proxy.java

Richard Emberson emberson@phc.net
Tue Dec 4 17:35:00 GMT 2001


Well, I tried to use the Proxy.java class and gcj does compile it but it
dies during execution ...
and I think the error I am running into is in gcj. Include is a zip file of
the code and
here is the gdb session:

 b natClass.cc:692
Breakpoint 5, java::lang::Class::initializeClass() (this=0x8053160)
    at ../../../gcc/libjava/java/lang/natClass.cc:692
692               _Jv_PrepareCompiledClass (this);
Current language:  auto; currently c++
(gdb) s
_Jv_PrepareCompiledClass(java::lang::Class*) (klass=0x8053160)
    at ../../../gcc/libjava/java/lang/natClassLoader.cc:247
247       if (klass->state >= JV_STATE_LINKED)
(gdb) s
251       klass->state = JV_STATE_LINKED;
(gdb) s
253       _Jv_Constants *pool = &klass->constants;
(gdb) p *pool
$1 = {size = 134678400, tags = 0x2 <Address 0x2 out of bounds>,
  data = 0x8053480}
(gdb)

I assume that a pool size should not be 134678400.

Also, I did a clean build of gcj today with the latest from CVS.

I made three changes to Proxy.java to get it to compile:
1) replaced Modifier.SUPER with 0x0020
2) In getProxyData replaced
          for (int j = i; j >= 0; j--)
            if (data.interfaces[j] == inter)
              throw new IllegalArgumentException("duplicate interface: "
                                                 + inter);
with

          for (int j = i-1; j >= 0; j--)
            if (data.interfaces[j] == inter)
              throw new IllegalArgumentException("duplicate interface: "
                                                 + inter);
Otherwise it checks interface against itself and fails, and
3) commented out all native code and calls.

Richard Emberson


Mark Wielaard wrote:

> Hi,
>
> On Tue, Dec 04, 2001 at 10:43:31AM -0800, Richard Emberson wrote:
> >
> > I am considering using java.lang.reflect.Proxy.java in something I am
> > writting, but I notice
> > that its not one of the classes supported by gcj. Is it on the schedule
> > (soon) for development?
>
> Eric Blake wrote that class a while ago for GNU Classpath.
> It has not yet been merged or tested with libgcj yet.
> (GNU Classpath and libgcj are slowly merging the standard class library
> implementations.)
>
> If you would have the time then it would be great if you could try
> and test the implementation from Classpath with gcj.
>
> <http://www.gnu.org/software/classpath/>
>
> Cheers,
>
> Mark
> --
> Stuff to read:
>     <http://www.toad.com/gnu/whatswrong.html>
>   What's Wrong with Copy Protection, by John Gilmore
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tmp.tar.gz
Type: application/x-gzip
Size: 17238 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java/attachments/20011204/b42cd7ee/attachment.bin>


More information about the Java mailing list