diff options
author | tomlu <tomlu@google.com> | 2017-10-12 03:30:43 +0200 |
---|---|---|
committer | Marcel Hlopko <hlopko@google.com> | 2017-10-12 10:17:03 +0200 |
commit | 5cca89f970bcaddb98972055f2d9539e9d225e67 (patch) | |
tree | 2cbb9d34b91663d63b88a2166d45095244b873af /src/main/java/com/google/devtools/build/lib/vfs/AbstractFileSystem.java | |
parent | 59984b5bb795f6067117be47c44ddb21ccc376de (diff) |
Remove synchronization from FileSystem implementations.
PiperOrigin-RevId: 171905267
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/vfs/AbstractFileSystem.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/vfs/AbstractFileSystem.java | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/vfs/AbstractFileSystem.java b/src/main/java/com/google/devtools/build/lib/vfs/AbstractFileSystem.java index a03ec02fc5..d1f3a4cd01 100644 --- a/src/main/java/com/google/devtools/build/lib/vfs/AbstractFileSystem.java +++ b/src/main/java/com/google/devtools/build/lib/vfs/AbstractFileSystem.java @@ -90,18 +90,16 @@ abstract class AbstractFileSystem extends FileSystem { @Override protected OutputStream getOutputStream(Path path, boolean append) throws IOException { - synchronized (path) { - try { - return createFileOutputStream(path, append); - } catch (FileNotFoundException e) { - // Why does it throw a *FileNotFoundException* if it can't write? - // That does not make any sense! And its in a completely different - // format than in other situations, no less! - if (e.getMessage().equals(path + ERR_PERMISSION_DENIED)) { - throw new FileAccessException(e.getMessage()); - } - throw e; + try { + return createFileOutputStream(path, append); + } catch (FileNotFoundException e) { + // Why does it throw a *FileNotFoundException* if it can't write? + // That does not make any sense! And its in a completely different + // format than in other situations, no less! + if (e.getMessage().equals(path + ERR_PERMISSION_DENIED)) { + throw new FileAccessException(e.getMessage()); } + throw e; } } |