Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6443125

Clarify that ThreadFactory.newThread can return null

XMLWordPrintable

      From an email from Joe Bowbeer:

      >TPE is the main consumer of ThreadFactory. There probably wouldn't be
      >> a TF in j.u.c. if it weren't for TPE. (As I recall, TF didn't make
      >> the first cut.)
      >>
      >> Currently the TF spec doesn't say what it does if it can't proceed.
      >> Does it throw an exception or return null? Most people will assume it
      >> does one or the other. But which?
      >>
      >> Unless null is mentioned in the doc, most people would not expect it,
      >> because "null" is not the Java way. By explicitly handling null
      >> return values, TPE is putting a stake in the ground. Without further
      >> clarification, like #3 below, my interpretation of this is that TF
      >> *can* return null.

      ...

      >> Change ThreadFactory spec to reflect TPE reality: TFs can return null.

      >> 1. Change ThreadFactory spec to reflect TPE reality:
      >> TFs can return null.

            martin Martin Buchholz
            martin Martin Buchholz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: