This method invokes Thread.currentThread()
just to call one of Thread
's static methods.
Most static methods of Thread
operate on the current thread, so there is no need to explicitly get the current thread object to call them.
boolean isInterrupted = Thread.currentThread().interrupted();
Just use the method with Thread
's class instance directly.
isInterrupted = Thread.interrupted();
java.lang.Thread