During test execution I noticed that sometimes shape is not applied to the window. So I created this test code (attached) which does nothing but creates JFrame with shape applied and checks whether it is really applied. If everything ok it disposes the frame and tries again.
On first run it failed on attempt #33. But for test execution it could be second or third window actually, so it doesn't seem to be related to memory leaks etc. It's rather race condition or something other random.
Windows Vista Aero