>AFAIK, it is not possible to modify core Java classes
>(not without cheating anyway). 

OK, if I did cheat (by replacing the system class loader?)
would it be possible? ie add instructions around a native method?

I want to make sure that _every_ call to System.currentTimeMillis()
runs our extra code - including our code, 3rd party libraries, and
system code.  Wouldn't scanning classses for calls to the method also
have the same problem with trying to modify system classes that call
currentTimeMillis().

Thanks again
Andrew

>You can, however, modify all other classes. For example,
>scan the classes for calls to invokestatic
>System.currentTimeMillis (very easy with BCEL), and
>replace them with invokestatic <your_class.your_method>.
>This simple replacement (as opposed to adding the code
>inline) would be your best bet, as it shouldn't require
>any other changes.
>You can do this ahead of time, or at run time with your
>own ClassLoader.
--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to