您可以使用AspectJ编译器/编织器来编译/编织有问题的用户代码,将对java.lang.System.currentTimeMillis()的调用替换为您自己的代码。以下方面将做到这一点:
public aspect CurrentTimeInMillisMethodCallChanger { long around(): call(public static native long java.lang.System.currentTimeMillis()) && within(user.pre.base.pckg.*) { return 0; //provide your own implementation returning a long }}


