Archie,

This test seems to pass ok, any way the problem in eclipse was fixed
by following change. (Sorry, do not have enough time to write the
test)

--------------------
--- a/libjc/resolve.c
+++ b/libjc/resolve.c
@@ -222,17 +222,12 @@ _jc_resolve_field(_jc_env *env, _jc_type
                       return field;
       }

-       /* Search for field in superclasses */
-       while (JNI_TRUE) {
-               if ((type = type->superclass) == NULL)
-                       break;
-               if ((field = _jc_get_declared_field(env,
-                   type, name, sig, is_static)) != NULL)
-                       return field;
-       }
+    if (!type->superclass)
+        return NULL;

-       /* Not found */
-       return NULL;
+       /* Search for field in superclasses */
+    return _jc_resolve_field(env,
+            type->superclass, name, sig, is_static);
}

/*
-----------------


2006/6/5, Ivan Volosyuk <[EMAIL PROTECTED]>:
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 <[EMAIL PROTECTED]>:
> 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:

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to