Bug in ShellFolder.

Paulo Levi i30817 at gmail.com
Thu Nov 12 18:24:28 PST 2009


In this thread, i found a bug similar to a strange exception i was
(not) seeing when overriding writeObject

http://forums.java.net/jive/thread.jspa?threadID=31316&tstart=0

I found that it occurs because of saving files returned by the
filechooser (extensions of sun.awt.shell.ShellFolder) when trying to
serialize on a shutdownhook,
because serializing triggers some file operation that needs to send a
task to a Executor that is already closed.
I avoid it by:
out.writeObject(new File(((File) first).getAbsolutePath()));
Couldn't something equivalent be done in writeReplace be used for the
same thing inside one of those classes?


More information about the nio-discuss mailing list