Ron McLeod wrote:Semaphore#acquire() calls a method which calls another method which can throw new InterruptedException(). No arguments means no message which will result in Throwable returning null for getMessage().
Thanks, Ron! That explains it perfectly. Do you have the source for
acquire? I remember being able to step into library routines at one time, but not on my current machine. I must have downloaded something to be able to do that, but can't recall what it was.
Based on your explanation, I'm inclined to see this as a bug. However, it turns out that the javadoc on
Throwable.getMessage actually says it may return
null. I would never have expected that and wonder if this is an example of a bug becoming a feature by amending the documentation to match the imperfect behavior.