commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eugene Kuleshov ...@javatx.org>
Subject javaflow: SimpleVerifier's getClass() method
Date Tue, 03 Jan 2006 16:33:21 GMT
Kohsuke,

   I've noticed your comment in svn for ContinuationMethodAnalyzer class:

--
SimpleVerifier assumes that the types involved in the computation is 
loadable through Class.forName(), which isn't true when we are running 
inside Ant.

The correct computation would require us to parse referenced types 
(through a pluggable resolver.) For now, I'm just replacing it with 
BasicVerifier.

Given that the purpose of this part of the code is just to check that 
we generated the right code, perhaps we can remove it altogether in 
the production system?

i.e.,

if(DEBUG) {
    ... run a verifier
}
--

   I mentioned before analyzer is used here to compute stack and 
locals slots for method instructions in order to be able to 
restore/cast to correct types when restoring continuation.

   Speaking about Ant, can you tell me how can I test this issue? Or 
maybe you can subclass SimpleVerifier yourself and overwrite following 
method:

   protected Class getClass(final Type t) {
     try {
       if (t.getSort() == Type.ARRAY) {
         return  getClass()
           .getClassLoader()
           .loadClass(t.getDescriptor().replace('/', '.'));
       }
       return getClass()
           .getClassLoader()
           .loadClass(t.getClassName());
     } catch (ClassNotFoundException e) {
       throw new RuntimeException(e.toString());
     }
   }

   Eric, I actually wonder if we can use 
getClass().getClassLoader().loadClass(...) (or 
Thread.currentThread().contextClassLoader().loadClass(...)) instead of 
Class.forName(...) method? Do you recall if there was some reasons to 
use Class.forName?

   regards,
   Eugene



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message