This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
when using with ant optit there is often a deadlock. Will attach patch proposed by Jarda.
Created attachment 11455 [details] Thread dump
Created attachment 11456 [details] Patch proposed by Jarda
Thanks for the thread dump, but the patch is not quite right I think - rather, Monitor should not start its timer until it is made visible; certainly not in the constructor.
Fixed by just running pack() and show() in EQ.
The patch solves the problem by correct ordering of locks. Your solution by serialization of "messages" into a processing queue. Arguing about good or bad is usually tricky, but as far as I know it is ok to call pack() and show() from non-awt thread so the EQ solution is a hack as it does not solve the root of the problem which is still there and only removes code that is correct acording to all swing threading rules.
Huh? You should not have to explicitly acquire the AWT tree lock when calling JTextComponent.setText from the EQ, surely. It *is* normally OK to call pack() and show() for undisplayed components. The problem was the timer that is part of Monitor - if the system is running really slowly, you can get a clock tick on the timer occurring before the pack() finishes laying out the component off EQ. My preferred fix would be to not start the timer until the component is really showing (i.e. JFrame.show()) but I was unable to find a straightforward way of detecting this event - addNotify certainly doesn't work, setVisible(true) is never called, even ComponentListener.showing did not work. So, a different fix is just to ensure that no uses of the tree lock occur off EQ, as I did.
closed