I am using a JAR file that uses System.currentTimeMillis()
to get the current system time. I want to call my current time method (nanoTime()
) when a function of JAR file calls System.currentTimeMillis()
.
Any suggestion how I can cover this?
I am using a JAR file that uses System.currentTimeMillis()
to get the current system time. I want to call my current time method (nanoTime()
) when a function of JAR file calls System.currentTimeMillis()
.
Any suggestion how I can cover this?
Well... implementing you own java.lang.System
comes into mind. But then you'd also need set your bootclasspath and who knows what else to make this work. You might end up patching rt.jar
.
It will be tricky though to reuse the "real" System
class for all other purposes.
And I hope you plan to do this on one machine only - I can't imagine the trouble to deploy such a system.