Tests and Lookup

Rémi Forax forax at univ-mlv.fr
Fri Jun 26 12:22:13 PDT 2009


I've finished to implement most parts of the backport,
and now I'm trying to run the tests provided

I've detected two problems :
- lot of tests in MethodHandleTests relies on sun.dyn.* classes
  thus fails with the backport. I suppose they are more like black box tests
  than white box tests.

- I've found that findStatic/findVirtual etc doesn't follow the VM spec 
but the JLS,
  i.e a class can access to all members of its inner classes.
  It is written (specified ?) in the doc of MethodHandles.Lookup:

//  In general, the conditions under which a method handle may be 
created for a method |M| are
  exactly as restrictive as the conditions under which the lookup class 
could have compiled a call to |M.

|//  I don't see the advantage of doesn't following the VM Spec.
  Or perhaps the VM spec has to be updated ?  

  By the way, JavaFX compiler allows access between classes in the same 
compilation unit
  but not  Java  compiler

  class A {
    class B {
       int x
    }
    class C {
      void m(B b) {
         b.x // allowed in JavaFX but not in Java.
      }
    }
  }

Rémi
//|
 
|// 
 



More information about the mlvm-dev mailing list