diff options
author | 2017-06-30 00:32:04 +0200 | |
---|---|---|
committer | 2017-06-30 13:00:58 +0200 | |
commit | 3d2a68c6da2a50a9e1bcf6615e83a43701cdf95d (patch) | |
tree | 31692a985d316e33733ab6993e529b8a08c206b6 /src/main/java/com/google/devtools/build/lib/windows/WindowsFileSystem.java | |
parent | 2d5eeab381713f99c8c8b7b80f3d447be847b548 (diff) |
Automated conversion to Java 8
With a few manual fixes for readability.
RELNOTES: None.
PiperOrigin-RevId: 160582556
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/windows/WindowsFileSystem.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/windows/WindowsFileSystem.java | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/windows/WindowsFileSystem.java b/src/main/java/com/google/devtools/build/lib/windows/WindowsFileSystem.java index 893a563c3e..e1eb08fc3b 100644 --- a/src/main/java/com/google/devtools/build/lib/windows/WindowsFileSystem.java +++ b/src/main/java/com/google/devtools/build/lib/windows/WindowsFileSystem.java @@ -69,19 +69,15 @@ public class WindowsFileSystem extends JavaIoFileSystem { /** Resolves DOS-style, shortened path names, returning the last segment's long form. */ private static final Function<String, String> WINDOWS_SHORT_PATH_RESOLVER = - new Function<String, String>() { - @Override - @Nullable - public String apply(String path) { - try { - // Since Path objects are created hierarchically, we know for sure that every segment of - // the path, except the last one, is already canonicalized, so we can return just that. - // Plus the returned value is passed to Path.getChild so we must not return a full - // path here. - return PathFragment.create(WindowsFileOperations.getLongPath(path)).getBaseName(); - } catch (IOException e) { - return null; - } + path -> { + try { + // Since Path objects are created hierarchically, we know for sure that every segment of + // the path, except the last one, is already canonicalized, so we can return just that. + // Plus the returned value is passed to Path.getChild so we must not return a full + // path here. + return PathFragment.create(WindowsFileOperations.getLongPath(path)).getBaseName(); + } catch (IOException e) { + return null; } }; |