wood burning stoves
The moose likes Java in General and the fly likes Thread.sleep() findbug Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Thread.sleep() findbug " Watch "Thread.sleep() findbug " New topic

Thread.sleep() findbug

Harshana Dias
Ranch Hand

Joined: Jun 11, 2007
Posts: 331

How to get reduce of the find bug error saying. Manual thread scheduling with Thread.sleep() or Thread.yield() has no guaranteed semantics and is often used to mask race conditions.

I just use it for sleep the current thread for a while and its not used with in a condition statement. But its used inside a junit test case which has a assert statement at the end.

Stephan van Hulst

Joined: Sep 20, 2010
Posts: 4600

The warning is there to draw your attention to it. If you don't want it, switch it off in your IDE.

The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.
I agree. Here's the link: http://aspose.com/file-tools
subject: Thread.sleep() findbug
It's not a secret anymore!