From b01995e5b726d8e94f57ed10a0fa829bece9a0a9 Mon Sep 17 00:00:00 2001 From: Arash Rouhani Date: Fri, 13 May 2016 11:12:45 +0700 Subject: [PATCH] Add descriptive error message to .toFile() I was a bit confused by only seeing the java.lang.UnsupportedOperationException without any further explanation. This error message would make it clear why the exception is thrown. --- jimfs/src/main/java/com/google/common/jimfs/JimfsPath.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jimfs/src/main/java/com/google/common/jimfs/JimfsPath.java b/jimfs/src/main/java/com/google/common/jimfs/JimfsPath.java index 691073b6b..6cab4915a 100644 --- a/jimfs/src/main/java/com/google/common/jimfs/JimfsPath.java +++ b/jimfs/src/main/java/com/google/common/jimfs/JimfsPath.java @@ -408,7 +408,7 @@ public URI toUri() { @Override public File toFile() { // documented as unsupported for anything but the default file system - throw new UnsupportedOperationException(); + throw new UnsupportedOperationException("You can not do .toFile() on a jimfs Path object"); } @Override