Thread.interrupted() spec is confusing

Tagir Valeev amaembo at gmail.com
Sun Feb 18 10:17:08 UTC 2018


Hello!

A Thread.interrupted() static method (not to be confused with
Thread.isInterrupted() instance method) spec states:

     * <http://hg.openjdk.java.net/jdk/jdk/file/67cdc215ed70/src/java.base/share/classes/java/lang/Thread.java#l1030>
    * <p>A thread interruption ignored because a thread was not alive
<http://hg.openjdk.java.net/jdk/jdk/file/67cdc215ed70/src/java.base/share/classes/java/lang/Thread.java#l1031>
    * at the time of the interrupt will be reflected by this method
<http://hg.openjdk.java.net/jdk/jdk/file/67cdc215ed70/src/java.base/share/classes/java/lang/Thread.java#l1032>
    * returning false.


The Thread.interrupted() always applies to the current thread. I don't
understand how it's possible that a current thread is not alive. To me this
note is redundant and should be removed. Am I missing something?

With best regards,
Tagir Valeev.


More information about the core-libs-dev mailing list