summaryrefslogtreecommitdiffstats
path: root/sched
diff options
context:
space:
mode:
authorPiotr Jastrzebski <haaawk@google.com>2015-03-04 15:48:43 +0000
committerPiotr Jastrzebski <haaawk@google.com>2015-03-19 11:48:22 +0000
commit29d9d54dc51c57ce81773a9377449700f90556df (patch)
tree49ea0d891195a24bfebd5ed74872677cf1389640 /sched
parent3a2129db18d560fd1412d9736cf3dfe7873236c6 (diff)
downloadtoolchain_jack-29d9d54dc51c57ce81773a9377449700f90556df.zip
toolchain_jack-29d9d54dc51c57ce81773a9377449700f90556df.tar.gz
toolchain_jack-29d9d54dc51c57ce81773a9377449700f90556df.tar.bz2
Stop creating message in NonSuchFileException unnecessarily
NoSuchFileException is thrown 29686 times during compilation of Music app but its message is not obtained even once. location.getDescription is not a cheap operation and message creation uses string concatenation as well. Instead of creating a message eagerily this change stores a reference to a location in the NonSuchFileExpection object and creates the message only when it's needed. This speeds up the creation of NoSuchFileException almost 40 times which makes a difference if we multiply it by almost 30k times it's created. We will also save on GC as it saves at least 3 object creations per NoSuchFileException which makes over 90k object creations saved. Fix also other exceptions in com.android.sched.util.file. Change-Id: Ibc2a413891a2e24be786f440196e9a4276215cc0
Diffstat (limited to 'sched')
-rw-r--r--sched/src/com/android/sched/util/file/CannotCreateFileException.java23
-rw-r--r--sched/src/com/android/sched/util/file/CannotDeleteFileException.java27
-rw-r--r--sched/src/com/android/sched/util/file/CannotReadException.java23
-rw-r--r--sched/src/com/android/sched/util/file/CannotSetPermissionException.java38
-rw-r--r--sched/src/com/android/sched/util/file/FileAlreadyExistsException.java27
-rw-r--r--sched/src/com/android/sched/util/file/NoSuchFileException.java22
-rw-r--r--sched/src/com/android/sched/util/file/NotDirectoryException.java22
-rw-r--r--sched/src/com/android/sched/util/file/NotFileException.java22
-rw-r--r--sched/src/com/android/sched/util/file/NotFileOrDirectoryException.java14
-rw-r--r--sched/src/com/android/sched/util/file/WithLocationException.java67
-rw-r--r--sched/src/com/android/sched/util/file/WrongPermissionException.java35
-rw-r--r--sched/src/com/android/sched/vfs/CachedDirectFS.java9
-rw-r--r--sched/src/com/android/sched/vfs/CaseInsensitiveFS.java6
-rw-r--r--sched/src/com/android/sched/vfs/DirectFS.java2
-rw-r--r--sched/src/com/android/sched/vfs/InMemoryVDir.java6
-rw-r--r--sched/src/com/android/sched/vfs/MessageDigestFS.java2
16 files changed, 275 insertions, 70 deletions
diff --git a/sched/src/com/android/sched/util/file/CannotCreateFileException.java b/sched/src/com/android/sched/util/file/CannotCreateFileException.java
index bf5b1fe..b637a54 100644
--- a/sched/src/com/android/sched/util/file/CannotCreateFileException.java
+++ b/sched/src/com/android/sched/util/file/CannotCreateFileException.java
@@ -16,25 +16,38 @@
package com.android.sched.util.file;
+import com.android.sched.util.location.HasLocation;
import com.android.sched.util.location.Location;
-import java.io.IOException;
-
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
/**
* Exception when a file or directory can not be created.
*/
-public class CannotCreateFileException extends IOException {
+public class CannotCreateFileException extends WithLocationException {
private static final long serialVersionUID = 1L;
public CannotCreateFileException(@Nonnull Location location) {
- this(location, null);
+ super(location, null);
}
public CannotCreateFileException(@Nonnull Location location,
@CheckForNull Throwable cause) {
- super(location.getDescription() + " can not be created", cause);
+ super(location, cause);
+ }
+
+ public CannotCreateFileException(@Nonnull HasLocation locationProvider) {
+ super(locationProvider, null);
+ }
+
+ public CannotCreateFileException(@Nonnull HasLocation locationProvider,
+ @CheckForNull Throwable cause) {
+ super(locationProvider, cause);
+ }
+
+ @Override
+ protected String createMessage(@Nonnull String description) {
+ return description + " can not be created";
}
}
diff --git a/sched/src/com/android/sched/util/file/CannotDeleteFileException.java b/sched/src/com/android/sched/util/file/CannotDeleteFileException.java
index 0779bda..7691d6c 100644
--- a/sched/src/com/android/sched/util/file/CannotDeleteFileException.java
+++ b/sched/src/com/android/sched/util/file/CannotDeleteFileException.java
@@ -16,25 +16,38 @@
package com.android.sched.util.file;
+import com.android.sched.util.location.HasLocation;
import com.android.sched.util.location.Location;
-import java.io.IOException;
-
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
/**
* Exception thrown when deletion of a file or a directory fails.
*/
-public class CannotDeleteFileException extends IOException {
+public class CannotDeleteFileException extends WithLocationException {
private static final long serialVersionUID = 1L;
public CannotDeleteFileException(@Nonnull Location location) {
- this(location, null);
+ super(location, null);
+ }
+
+ public CannotDeleteFileException(@Nonnull Location location,
+ @CheckForNull Throwable cause) {
+ super(location, cause);
+ }
+
+ public CannotDeleteFileException(@Nonnull HasLocation locationProvider) {
+ super(locationProvider, null);
+ }
+
+ public CannotDeleteFileException(@Nonnull HasLocation locationProvider,
+ @CheckForNull Throwable cause) {
+ super(locationProvider, cause);
}
- public CannotDeleteFileException(
- @Nonnull Location location, @CheckForNull Throwable cause) {
- super(location.getDescription() + " can not be deleted", cause);
+ @Override
+ protected String createMessage(@Nonnull String description) {
+ return description + " can not be deleted";
}
}
diff --git a/sched/src/com/android/sched/util/file/CannotReadException.java b/sched/src/com/android/sched/util/file/CannotReadException.java
index d34fecf..9b00a93 100644
--- a/sched/src/com/android/sched/util/file/CannotReadException.java
+++ b/sched/src/com/android/sched/util/file/CannotReadException.java
@@ -16,25 +16,38 @@
package com.android.sched.util.file;
+import com.android.sched.util.location.HasLocation;
import com.android.sched.util.location.Location;
-import java.io.IOException;
-
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
/**
* Exception when a file can not be read.
*/
-public class CannotReadException extends IOException {
+public class CannotReadException extends WithLocationException {
private static final long serialVersionUID = 1L;
public CannotReadException(@Nonnull Location location) {
- this(location, null);
+ super(location, null);
}
public CannotReadException(@Nonnull Location location,
@CheckForNull Throwable cause) {
- super(location.getDescription() + " can not be read", cause);
+ super(location, cause);
+ }
+
+ public CannotReadException(@Nonnull HasLocation locationProvider) {
+ super(locationProvider, null);
+ }
+
+ public CannotReadException(@Nonnull HasLocation locationProvider,
+ @CheckForNull Throwable cause) {
+ super(locationProvider, cause);
+ }
+
+ @Override
+ protected String createMessage(@Nonnull String description) {
+ return description + " can not be read";
}
}
diff --git a/sched/src/com/android/sched/util/file/CannotSetPermissionException.java b/sched/src/com/android/sched/util/file/CannotSetPermissionException.java
index 3f15f1d..59c203b 100644
--- a/sched/src/com/android/sched/util/file/CannotSetPermissionException.java
+++ b/sched/src/com/android/sched/util/file/CannotSetPermissionException.java
@@ -18,19 +18,22 @@ package com.android.sched.util.file;
import com.android.sched.util.file.FileOrDirectory.ChangePermission;
import com.android.sched.util.file.FileOrDirectory.Permission;
+import com.android.sched.util.location.HasLocation;
import com.android.sched.util.location.Location;
-import java.io.IOException;
-
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
/**
* Exception when a file or directory can not be set to the expected permission.
*/
-public class CannotSetPermissionException extends IOException {
+public class CannotSetPermissionException extends WithLocationException {
private static final long serialVersionUID = 1L;
+ private final int permission;
+ @Nonnull
+ private final ChangePermission change;
+
public CannotSetPermissionException(@Nonnull Location location, int permission,
@Nonnull ChangePermission change) {
this(location, permission, change, null);
@@ -38,10 +41,29 @@ public class CannotSetPermissionException extends IOException {
public CannotSetPermissionException(@Nonnull Location location, int permission,
@Nonnull ChangePermission change, @CheckForNull Throwable cause) {
- super(location.getDescription() + " can not be set " +
- ((permission == Permission.READ) ? "readable" :
- ((permission == Permission.WRITE) ? "writable" :
- ((permission == Permission.EXECUTE) ? "executable" : "???"))) +
- ((change == ChangePermission.EVERYBODY) ? " for everybody" : ""), cause);
+ super(location, cause);
+ this.permission = permission;
+ this.change = change;
+ }
+
+ public CannotSetPermissionException(@Nonnull HasLocation locationProvider, int permission,
+ @Nonnull ChangePermission change) {
+ this(locationProvider, permission, change, null);
+ }
+
+ public CannotSetPermissionException(@Nonnull HasLocation locationProvider, int permission,
+ @Nonnull ChangePermission change, @CheckForNull Throwable cause) {
+ super(locationProvider, cause);
+ this.permission = permission;
+ this.change = change;
+ }
+
+ @Override
+ protected String createMessage(@Nonnull String description) {
+ return description + " can not be set " +
+ ((permission == Permission.READ) ? "readable" :
+ ((permission == Permission.WRITE) ? "writable" :
+ ((permission == Permission.EXECUTE) ? "executable" : "???"))) +
+ ((change == ChangePermission.EVERYBODY) ? " for everybody" : "");
}
}
diff --git a/sched/src/com/android/sched/util/file/FileAlreadyExistsException.java b/sched/src/com/android/sched/util/file/FileAlreadyExistsException.java
index 4e1f070..8c622ee 100644
--- a/sched/src/com/android/sched/util/file/FileAlreadyExistsException.java
+++ b/sched/src/com/android/sched/util/file/FileAlreadyExistsException.java
@@ -16,25 +16,38 @@
package com.android.sched.util.file;
+import com.android.sched.util.location.HasLocation;
import com.android.sched.util.location.Location;
-import java.io.IOException;
-
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
/**
* Exception when a file or directory of that name already exists.
*/
-public class FileAlreadyExistsException extends IOException {
+public class FileAlreadyExistsException extends WithLocationException {
private static final long serialVersionUID = 1L;
public FileAlreadyExistsException(@Nonnull Location location) {
- this(location, null);
+ super(location, null);
+ }
+
+ public FileAlreadyExistsException(@Nonnull Location location,
+ @CheckForNull Throwable cause) {
+ super(location, cause);
+ }
+
+ public FileAlreadyExistsException(@Nonnull HasLocation locationProvider) {
+ super(locationProvider, null);
+ }
+
+ public FileAlreadyExistsException(@Nonnull HasLocation locationProvider,
+ @CheckForNull Throwable cause) {
+ super(locationProvider, cause);
}
- public FileAlreadyExistsException(
- @Nonnull Location location, @CheckForNull Throwable cause) {
- super(location.getDescription() + " already exists", cause);
+ @Override
+ protected String createMessage(@Nonnull String description) {
+ return description + " already exists";
}
}
diff --git a/sched/src/com/android/sched/util/file/NoSuchFileException.java b/sched/src/com/android/sched/util/file/NoSuchFileException.java
index 16926e4..abaaf0c 100644
--- a/sched/src/com/android/sched/util/file/NoSuchFileException.java
+++ b/sched/src/com/android/sched/util/file/NoSuchFileException.java
@@ -16,24 +16,36 @@
package com.android.sched.util.file;
+import com.android.sched.util.location.HasLocation;
import com.android.sched.util.location.Location;
-import java.io.IOException;
-
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
/**
* Exception when a file or directory does not exist.
*/
-public class NoSuchFileException extends IOException {
+public class NoSuchFileException extends WithLocationException {
private static final long serialVersionUID = 1L;
public NoSuchFileException(@Nonnull Location location) {
- this(location, null);
+ super(location, null);
}
public NoSuchFileException(@Nonnull Location location, @CheckForNull Throwable cause) {
- super(location.getDescription() + " does not exist", cause);
+ super(location, cause);
+ }
+
+ public NoSuchFileException(@Nonnull HasLocation locationProvider) {
+ super(locationProvider, null);
+ }
+
+ public NoSuchFileException(@Nonnull HasLocation location, @CheckForNull Throwable cause) {
+ super(location, cause);
+ }
+
+ @Override
+ protected String createMessage(@Nonnull String description) {
+ return description + " does not exist";
}
}
diff --git a/sched/src/com/android/sched/util/file/NotDirectoryException.java b/sched/src/com/android/sched/util/file/NotDirectoryException.java
index c47ff69..a0c3dab 100644
--- a/sched/src/com/android/sched/util/file/NotDirectoryException.java
+++ b/sched/src/com/android/sched/util/file/NotDirectoryException.java
@@ -16,6 +16,7 @@
package com.android.sched.util.file;
+import com.android.sched.util.location.HasLocation;
import com.android.sched.util.location.Location;
import javax.annotation.CheckForNull;
@@ -27,11 +28,24 @@ import javax.annotation.Nonnull;
public class NotDirectoryException extends NotFileOrDirectoryException {
private static final long serialVersionUID = 1L;
- public NotDirectoryException(@Nonnull Location expected) {
- this(expected, null);
+ public NotDirectoryException(@Nonnull Location location) {
+ super(location, null);
}
- public NotDirectoryException(@Nonnull Location expected, @CheckForNull Throwable cause) {
- super(expected.getDescription() + " is not actually a directory", cause);
+ public NotDirectoryException(@Nonnull Location location, @CheckForNull Throwable cause) {
+ super(location, cause);
+ }
+
+ public NotDirectoryException(@Nonnull HasLocation locationProvider) {
+ super(locationProvider, null);
+ }
+
+ public NotDirectoryException(@Nonnull HasLocation location, @CheckForNull Throwable cause) {
+ super(location, cause);
+ }
+
+ @Override
+ protected String createMessage(@Nonnull String description) {
+ return description + " is not actually a directory";
}
}
diff --git a/sched/src/com/android/sched/util/file/NotFileException.java b/sched/src/com/android/sched/util/file/NotFileException.java
index 87a8578..9d5cfc5 100644
--- a/sched/src/com/android/sched/util/file/NotFileException.java
+++ b/sched/src/com/android/sched/util/file/NotFileException.java
@@ -16,6 +16,7 @@
package com.android.sched.util.file;
+import com.android.sched.util.location.HasLocation;
import com.android.sched.util.location.Location;
import javax.annotation.CheckForNull;
@@ -27,11 +28,24 @@ import javax.annotation.Nonnull;
public class NotFileException extends NotFileOrDirectoryException {
private static final long serialVersionUID = 1L;
- public NotFileException(@Nonnull Location expected) {
- this(expected, null);
+ public NotFileException(@Nonnull Location location) {
+ super(location, null);
}
- public NotFileException(@Nonnull Location expected, @CheckForNull Throwable cause) {
- super(expected.getDescription() + " is not actually a file", cause);
+ public NotFileException(@Nonnull Location location, @CheckForNull Throwable cause) {
+ super(location, cause);
+ }
+
+ public NotFileException(@Nonnull HasLocation locationProvider) {
+ super(locationProvider, null);
+ }
+
+ public NotFileException(@Nonnull HasLocation location, @CheckForNull Throwable cause) {
+ super(location, cause);
+ }
+
+ @Override
+ protected String createMessage(@Nonnull String description) {
+ return description + " is not actually a file";
}
}
diff --git a/sched/src/com/android/sched/util/file/NotFileOrDirectoryException.java b/sched/src/com/android/sched/util/file/NotFileOrDirectoryException.java
index 37b0899..43e55b4 100644
--- a/sched/src/com/android/sched/util/file/NotFileOrDirectoryException.java
+++ b/sched/src/com/android/sched/util/file/NotFileOrDirectoryException.java
@@ -16,7 +16,8 @@
package com.android.sched.util.file;
-import java.io.IOException;
+import com.android.sched.util.location.HasLocation;
+import com.android.sched.util.location.Location;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
@@ -24,14 +25,15 @@ import javax.annotation.Nonnull;
/**
* Exception when a path is not from the expected file or directory kind.
*/
-public abstract class NotFileOrDirectoryException extends IOException {
+public abstract class NotFileOrDirectoryException extends WithLocationException {
private static final long serialVersionUID = 1L;
- public NotFileOrDirectoryException(@Nonnull String string) {
- super(string);
+ public NotFileOrDirectoryException(@Nonnull Location location, @CheckForNull Throwable cause) {
+ super(location, cause);
}
- public NotFileOrDirectoryException(@Nonnull String string, @CheckForNull Throwable cause) {
- super(string, cause);
+ public NotFileOrDirectoryException(@Nonnull HasLocation locationProvider,
+ @CheckForNull Throwable cause) {
+ super(locationProvider, cause);
}
}
diff --git a/sched/src/com/android/sched/util/file/WithLocationException.java b/sched/src/com/android/sched/util/file/WithLocationException.java
new file mode 100644
index 0000000..4d5a08f
--- /dev/null
+++ b/sched/src/com/android/sched/util/file/WithLocationException.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.sched.util.file;
+
+import com.android.sched.util.location.HasLocation;
+import com.android.sched.util.location.Location;
+
+import java.io.IOException;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
+
+/**
+ * Common superclass for exceptions which are related to a specific location.
+ */
+public abstract class WithLocationException extends IOException {
+ private static final long serialVersionUID = 1L;
+
+ @CheckForNull
+ private final Location location;
+ @CheckForNull
+ private final HasLocation locationProvider;
+
+ @Nonnull
+ protected abstract String createMessage(@Nonnull String description);
+
+ protected WithLocationException(@Nonnull Location location, @CheckForNull Throwable cause) {
+ super("", cause);
+ assert location != null;
+ this.location = location;
+ this.locationProvider = null;
+ }
+
+ protected WithLocationException(@Nonnull HasLocation locationProvider,
+ @CheckForNull Throwable cause) {
+ super("", cause);
+ assert locationProvider != null;
+ this.location = null;
+ this.locationProvider = locationProvider;
+ }
+
+ @Override
+ @Nonnull
+ public String getMessage() {
+ if (location != null) {
+ return createMessage(location.getDescription());
+ }
+ if (locationProvider != null) {
+ return createMessage(locationProvider.getLocation().getDescription());
+ }
+ throw new AssertionError();
+ }
+}
diff --git a/sched/src/com/android/sched/util/file/WrongPermissionException.java b/sched/src/com/android/sched/util/file/WrongPermissionException.java
index e4faea0..f046d90 100644
--- a/sched/src/com/android/sched/util/file/WrongPermissionException.java
+++ b/sched/src/com/android/sched/util/file/WrongPermissionException.java
@@ -17,28 +17,47 @@
package com.android.sched.util.file;
import com.android.sched.util.file.FileOrDirectory.Permission;
+import com.android.sched.util.location.HasLocation;
import com.android.sched.util.location.Location;
-import java.io.IOException;
-
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
/**
* Exception when a file or directory have not the expected permission.
*/
-public class WrongPermissionException extends IOException {
+public class WrongPermissionException extends WithLocationException {
private static final long serialVersionUID = 1L;
+ private final int permission;
+
public WrongPermissionException(@Nonnull Location location, int permission) {
- this(location, permission, null);
+ super(location, null);
+ this.permission = permission;
}
public WrongPermissionException(@Nonnull Location location, int permission,
@CheckForNull Throwable cause) {
- super(location.getDescription() + " is not " +
- ((permission == Permission.READ) ? "readable" :
- ((permission == Permission.WRITE) ? "writable" :
- ((permission == Permission.EXECUTE) ? "executable" : "???"))), cause);
+ super(location, cause);
+ this.permission = permission;
+ }
+
+ public WrongPermissionException(@Nonnull HasLocation locationProvider, int permission) {
+ super(locationProvider, null);
+ this.permission = permission;
+ }
+
+ public WrongPermissionException(@Nonnull HasLocation location, int permission,
+ @CheckForNull Throwable cause) {
+ super(location, cause);
+ this.permission = permission;
+ }
+
+ @Override
+ protected String createMessage(@Nonnull String description) {
+ return description + " is not " +
+ ((permission == Permission.READ) ? "readable" :
+ ((permission == Permission.WRITE) ? "writable" :
+ ((permission == Permission.EXECUTE) ? "executable" : "???")));
}
}
diff --git a/sched/src/com/android/sched/vfs/CachedDirectFS.java b/sched/src/com/android/sched/vfs/CachedDirectFS.java
index de2deee..83512be 100644
--- a/sched/src/com/android/sched/vfs/CachedDirectFS.java
+++ b/sched/src/com/android/sched/vfs/CachedDirectFS.java
@@ -288,7 +288,7 @@ public class CachedDirectFS extends BaseVFS<CachedParentVDir, CachedParentVFile>
File path = getNativeFile(file.getPath());
if (!path.delete() || path.exists()) {
- throw new CannotDeleteFileException(file.getLocation());
+ throw new CannotDeleteFileException(file);
}
file.deleteFromCache();
@@ -297,8 +297,8 @@ public class CachedDirectFS extends BaseVFS<CachedParentVDir, CachedParentVFile>
@Override
@Nonnull
- synchronized CachedParentVFile createVFile(@Nonnull CachedParentVDir parent, @Nonnull String name)
- throws CannotCreateFileException {
+ synchronized CachedParentVFile createVFile(@Nonnull CachedParentVDir parent,
+ @Nonnull String name) throws CannotCreateFileException {
assert !isClosed();
try {
@@ -324,7 +324,8 @@ public class CachedDirectFS extends BaseVFS<CachedParentVDir, CachedParentVFile>
@Override
@Nonnull
- synchronized CachedParentVDir createVDir(@Nonnull CachedParentVDir parent, @Nonnull String name)
+ synchronized CachedParentVDir createVDir(@Nonnull CachedParentVDir parent,
+ @Nonnull String name)
throws CannotCreateFileException {
assert !isClosed();
diff --git a/sched/src/com/android/sched/vfs/CaseInsensitiveFS.java b/sched/src/com/android/sched/vfs/CaseInsensitiveFS.java
index 1188bf4..1c81dfa 100644
--- a/sched/src/com/android/sched/vfs/CaseInsensitiveFS.java
+++ b/sched/src/com/android/sched/vfs/CaseInsensitiveFS.java
@@ -379,11 +379,11 @@ public class CaseInsensitiveFS extends BaseVFS<CaseInsensitiveVDir, CaseInsensit
BaseVFile encoded = vfs.getRootDir().getVFile(encode(file.getPath()));
vfs.delete(encoded);
} catch (NotDirectoryException e) {
- throw new CannotDeleteFileException(file.getLocation());
+ throw new CannotDeleteFileException(file);
} catch (NotFileException e) {
- throw new CannotDeleteFileException(file.getLocation());
+ throw new CannotDeleteFileException(file);
} catch (NoSuchFileException e) {
- throw new CannotDeleteFileException(file.getLocation());
+ throw new CannotDeleteFileException(file);
}
}
diff --git a/sched/src/com/android/sched/vfs/DirectFS.java b/sched/src/com/android/sched/vfs/DirectFS.java
index a9537f6..b280a40 100644
--- a/sched/src/com/android/sched/vfs/DirectFS.java
+++ b/sched/src/com/android/sched/vfs/DirectFS.java
@@ -223,7 +223,7 @@ public class DirectFS extends BaseVFS<ParentVDir, ParentVFile> implements VFS {
File path = getNativeFile(file.getPath());
if (!path.delete() || path.exists()) {
- throw new CannotDeleteFileException(file.getLocation());
+ throw new CannotDeleteFileException(file);
}
}
diff --git a/sched/src/com/android/sched/vfs/InMemoryVDir.java b/sched/src/com/android/sched/vfs/InMemoryVDir.java
index 4ace1fc..ad6f186 100644
--- a/sched/src/com/android/sched/vfs/InMemoryVDir.java
+++ b/sched/src/com/android/sched/vfs/InMemoryVDir.java
@@ -83,7 +83,8 @@ abstract class InMemoryVDir extends BaseVDir {
@Override
@Nonnull
- public synchronized BaseVDir createVDir(@Nonnull String name) throws CannotCreateFileException {
+ public synchronized BaseVDir createVDir(@Nonnull String name)
+ throws CannotCreateFileException {
try {
return getVDir(name);
} catch (NoSuchFileException e) {
@@ -98,7 +99,8 @@ abstract class InMemoryVDir extends BaseVDir {
@Override
@Nonnull
- public synchronized BaseVFile createVFile(@Nonnull String name) throws CannotCreateFileException {
+ public synchronized BaseVFile createVFile(@Nonnull String name)
+ throws CannotCreateFileException {
try {
return getVFile(name);
} catch (NoSuchFileException e) {
diff --git a/sched/src/com/android/sched/vfs/MessageDigestFS.java b/sched/src/com/android/sched/vfs/MessageDigestFS.java
index 294eb6d..d01c1e0 100644
--- a/sched/src/com/android/sched/vfs/MessageDigestFS.java
+++ b/sched/src/com/android/sched/vfs/MessageDigestFS.java
@@ -197,7 +197,7 @@ public class MessageDigestFS extends BaseVFS<BaseVDir, MessageDigestVFile> imple
}
} catch (IOException e) {
throw new WrongVFSFormatException(this, vfs.getLocation(), new CannotReadException(
- digestFile.getLocation()));
+ digestFile));
}
} finally {
if (in != null) {