interesting thread on a javasound design flaw

https://forums.oracle.com/forums/thread.jspa?threadID=2379571

Just thought I’d share it, if only to have a laugh at the old Sun engineers (check the comments of the source snippets posted). Maybe not news to some people here, its pretty well known that JavaSound isn’t the best API in the package.

Interesting read indeed!

It really proves that JavaSound is so poor it should be removed or rewritten entirely…
I want to laugh at it, but I can relate to the authors troubles with it all to well for it to be funny…

:-\

  • Scarzzurs

Yeah I wasn’t clear enough at all - I more refer to that comment actually being in open source code :wink: Oops!

The actual fact that a comment is still there in stead of a fix is indeed sad, not funny.

I agree with you but will Oracle ever fix this bug?

I’m fairly sure this class is actually gone from OpenJDK and Java 7. Which is not to say that the DirectAudioDevice lines don’t also seem to swallow some InterruptedExceptions. Not great practice, but then I don’t agree with the OP’s (well OP’s OP’s!) decision to use the interrupted flag for this purpose. Having a private flag that your code alone has access to is the way to approach this (and not the workaround as it’s described).