Jon Camilleri wrote:Well is it safe to remove the catch? In any case the 'ball' does not seem to move anywhere with this code, when I remove the catch clause.
So, let's look at the error message from the compiler:
exception java.lang.InterruptedException is never thrown in body of corresponding try statement catch (InterruptedException e)
Read it carefully and try to understand it. What does it say? It says that in the try-block there isn't any code that can ever throw InterruptedException. In other words, catching InterruptedException is unnecessary here, because it will never be thrown from the try-block.
So, what do you think, is it safe to remove the catch?