Hi Stefano,
thanks for the suggestion.
The proposed code did not actually work as we can't use cc.toClass()
because that freezes the class, preventing the instrumentation agent
from redefining it.
However, your hint made me see there's a simple getName() method on
CtClass... which allows for full class name retrieval without having to
actually load the class. And that solves my problem of deriving the
class name from a file name.
Cheers
Alessio
Stefano Maestri wrote:
> AFAIK javaassist could help you with this:
>
> ClassPool cp = ClassPool.getDefault();
> InputStream ins = /an input stream for reading a class file/;
> <mailto:
tested...@googlegroups.com>.
> <mailto:
testedby-dev%2Bunsu...@googlegroups.com>.