title: Java 7 URL connection hangs
body: <p>While executing the following under Java 7, the program hangs.  However, it doesn't hang under Java 6.</p>
  
  <pre><code>package pkg;
  
  import java.io.BufferedReader;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.net.URL;
  
  final public class Main
  {
      public static void main(String[] args)
      {
          try
          {
              URL url = new URL("http://en.wikipedia.org/wiki/Cancer");
              BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
              String line;
              while((line = in.readLine())!= null)
              {
                  System.out.println(line);
              }
              in.close();
          }
          catch (IOException ex)
          {
              ex.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>What might be the reason?</p>