commons-dev mailing list archives

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

   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 

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?


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 

   protected Class getClass(final Type t) {
     try {
       if (t.getSort() == Type.ARRAY) {
         return  getClass()
           .loadClass(t.getDescriptor().replace('/', '.'));
       return getClass()
     } 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?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message