Re: Re: Re: ASM4 / Java 7

Rémi Forax <[email protected]>
Newsgroups gmane.comp.java.objectweb.asm
Message-ID <[email protected]>
On 08/27/2011 04:24 AM, Jeremy Manson wrote:
> Hi Eugene,
>
> This occurred to me when writing my version.  For my use case, which
> rewrites at class load time using java.lang.instrument, the vast
> majority of necessary superclasses are going to be available at
> rewrite time.  My code tries to use Class.forName first: only if the
> class is unavailable does it try to load it from the classloader.  I
> don't know if that is a good enough strategy to checkin as is, but it
> seems preferable to what's in there now, which tries Class.forName,
> and then dies on failure.
>
> This isn't good enough for pure static rewriting, of course.  For
> that, you probably need the user to supply the superclasses - the ones
> on the classpath may not be the ones you want.
>
> Jeremy

Hi Jeremy,
do you have tried to use Class.forName(name, false, classloader)
that avoid to link the class
(and run the static init block) instead of Class.forName(name).

If the bytecode is available through a classloader,
reflection should work.

Rémi
message-footer.txt (text/plain, 238 B)
-- 
You receive this message as a subscriber of the [email protected] mailing list.
To unsubscribe: mailto:[email protected]
For general help: mailto:[email protected]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.