title: JDK-7 SwingWorker deadlocks?
body: <p>I have a small image processing application which does multiple things at once using SwingWorker. However, if I run the following code (oversimplified excerpt), it just hangs on JDK 7 b70 (windows) but works in 6u16. It starts a new worker within another worker and waits for its result (the real app runs multiple sub-workers and waits for all this way). Did I use some wrong patterns here (as mostly there is 3-5 workers in the swingworker-pool, which has limit of 10 I think)?</p>
  
  <pre><code>import javax.swing.SwingUtilities;
  import javax.swing.SwingWorker;
  
  public class Swing {
         static SwingWorker&lt;String, Void&gt; getWorker2() {
                 return new SwingWorker&lt;String, Void&gt;() {
                         @Override
                         protected String doInBackground() throws Exception {
                                 return "Hello World";
                         }
                 };
         }
         static void runWorker() {
                 SwingWorker&lt;String, Void&gt; worker 
                     = new SwingWorker&lt;String, Void&gt;() {
                         @Override
                         protected String doInBackground() throws Exception {
                                 SwingWorker&lt;String, Void&gt; sw2 = getWorker2();
                                 sw2.execute();
                                 return sw2.get();
                         }
                 };
                 worker.execute();
                 try {
                         System.out.println(worker.get());
                 } catch (Exception e) {
                         e.printStackTrace();
                 }
         }
         public static void main(String[] args) {
                 SwingUtilities.invokeLater(new Runnable() {
                         @Override
                         public void run() {
                                 runWorker();
                         }
                 });
         }
  
  }
  </code></pre>