Community
Participate
Working Groups
Created attachment 283017 [details] The code location causing the IOException With https://bugs.eclipse.org/bugs/show_bug.cgi?id=500153 the method org.eclipse.core.internal.filebuffers.FileStoreTextFileBuffer.setFileContents(...) was changed to use try-with-resources. This change now leads to an IOException. When the output stream is fully read it is closed by the code. Up until the change of Bug 500153 this was completely ok. After the change, the Java runtime will try to close the stream again (auto-closable) which leads to the IOException Link to code: https://git.eclipse.org/c/platform/eclipse.platform.text.git/tree/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/FileStoreTextFileBuffer.java
Interesting. Can you provide the stack trace or a sample code producing the IOException? Few default implementations of OutputStream I've checked shouldn't throw on calling close() two times, just wondering which one you have in mind.
Hmm.. the documentation of Closeable.close() says that invoking it on an already closed stream does not have any effect. This indeed points to a file store implementation that does not honor this contract. Thanks for the hint, looking further into this...