-
Task
-
Resolution: Done
-
Minor
-
4.5.0.Final
-
None
When storing binary files in the FS binary store, ModeShape calculates the SHA1 of the binary data. This is done via a hashing stream which atm. is closed twice after the SHA1 is computed.
As per the contract of the close method:
public interface Closeable extends AutoCloseable { /** * Closes this stream and releases any system resources associated * with it. If the stream is already closed then invoking this * method has no effect. * * <p> As noted in {@link AutoCloseable#close()}, cases where the * close may fail require careful attention. It is strongly advised * to relinquish the underlying resources and to internally * <em>mark</em> the {@code Closeable} as closed, prior to throwing * the {@code IOException}. * * @throws IOException if an I/O error occurs */ public void close() throws IOException;
this should not be a problem. It seems however that certain streams (see linked forum issue) do not implement this contract properly, causing potential exceptions.