harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivan Volosyuk" <ivan.volos...@gmail.com>
Subject Re: jchevm status?
Date Mon, 05 Jun 2006 14:53:22 GMT
The difference is that access to that field should be done without
reflection. I don't have the jchevm at hand, but I think the
problematic code should look like:

interface I {
    static final int field = 123;
}

class S implements I {
}

public static C extends S {
   public static void main(String[] args) {
       System.out.println(field);
   }
}

I didn't tested wether it fails. I will check it when get home.
--
Ivan

2006/6/5, Archie Cobbs <archie@dellroad.org>:
> Ivan Volosyuk wrote:
> > Btw, I have found problem is classloader in jchevm.
> > Resolution of field in interface of superclass of some class fails.
> > Reproducible at eclipse. I have a patch with fix. It's quite simple. I
> > can send it at evening too.
>
> Do you have a simple test case? This one seems to work OK:
>
>      public class FieldRes {
>          public static interface FieldResInterface {
>              int field = 123;
>          }
>          public static class FieldResSuperclass implements FieldResInterface {
>          }
>          public static class FieldResClass extends FieldResSuperclass {
>          }
>          public static void main(String[] args) throws Exception {
>              FieldResClass obj = new FieldResClass();
>              System.out.println(obj.getClass().getField("field"));
>              System.out.println(obj.field);
>          }
>      }
>
> -Archie
>
> __________________________________________________________________________
> Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>


-- 
Ivan
Intel Middleware Products Division

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message