Eugene Kuleshov wrote:
Kohsuke,I've tried to run unit tests for asm transformer on code from SVN and noticed that they all failing. I believe the reason is that you've changed SimpleVerifier to BasicVerifier in the method analyzer and not all of the checkcasts created with Object type. So, I am afraid that we'll have to use SimpleVerifier to get the actual types of the stack and local values.
OK. I'll roll it back to SimpleVerifier. .... I guess your patch also fixed this. Thank you.
Another possible approach could be to use results of DataflowInterpeter to find an instructions that are consuming given stack value and then cast to the type required by this instruction, but I am not sure if there are some gaps in this approach, e.g. if locals will cause issues...
I don't think it's possible. The same variable maybe assigned to, say, java.lang.Comparable and java.io.Serializable. Consider the following code:
SomeMiddleClass x;
if(...)
x = new ClassX();
else
x = new ClassY();
someFunctionCall();
if(...) {
methodThatTakesSerializable(x);
} else {
methodThatTakesComparable(x);
}
Given that bytecode doesn't have the type for 'x', correctly restoring
'x' at someFunctionCall requires us to really find the common base type
as described in the JVM spec.
It shouldn't be too difficult; BCEL does that. As I wrote in the commit message, all we need is a resolver that can get you the byte code image of those referenced classes (like ClassX and ClassY.)
-- Kohsuke Kawaguchi Sun Microsystems [EMAIL PROTECTED]
smime.p7s
Description: S/MIME Cryptographic Signature
