What I have done here is a narrow focus on: what is the role of InterruptedException and my re-code may not be effective for Can you give clear explantion on that. Also, it may or may not interrupt, depending on things the code does not attempt to control. As EFH states, your originally posted code does not call interrupt() - which would mean no InterruptedException to catch.
For Object.notify() we have:
/** * The awakened thread will not be able to proceed until the current thread relinquishes the * lock on this object. The awakened thread will compete in the usual manner with any other * threads that might be actively competing to synchronize on this object; for example, the * awakened thread enjoys no reliable privilege or disadvantage in being the next thread to * lock this object. */
Which does not say anything about InterruptedException, the re-write uses Thread.interrupt()