FileDownloader SocketException - 7.4.2

The following always throws a “java.net.SocketException: Connection reset” when the download completes:

downloadButton = new Button("Download Zip");
FileDownloader downloader = new FileDownloader(new FileResource(zipFile));
downloader.extend(downloadButton);

The downloaded file is uncorrupted, and the application appears to continue to work as expected.
Although push is used, the above code is running in the UI thread.
Bug, or have I missed something?

Vaadin version: 7.4.2, automatic push enabled
Server: Tomcat 7.0.59
JDK version: OpenJDK 1.7.0_75 64 bit

Solution found, by random experimentation.

There’s a crucial but oh-so-obvious line missing from the original code snippet:

layout.addComponent(downloadButton);

The SocketException only occurs if the button is added to the layout
after
it has been extended. Add it immediately after construction and everything works as documented.