I want to disable possibility of using Thread.sleep() in a java project and use my own method instead:
sleep(int time, String info)
That will wait for given amount of time, and print info why is waiting necessary here.
Is disabling Thread.sleep() possible?
If yes, what's best method to do so?
The best method would be to have hook on some static code analysis tool to mark build as failed if there are any invocations of Thread.Sleep().
You could probably configure SonarCube to do this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With