diff options
author | Nathan Harmata <nharmata@google.com> | 2016-10-13 18:17:48 +0000 |
---|---|---|
committer | Yue Gan <yueg@google.com> | 2016-10-14 09:32:53 +0000 |
commit | 0c7a42a09d85ddffd9b860bcb31e4c43a00632c1 (patch) | |
tree | ec637fb0aedd23c75b066bbbc27f96ae0362324c /src/main/java/com/google/devtools/build/lib/skyframe/DirectoryListingStateFunction.java | |
parent | 7c3d668a9c598110256495d2863b53c9d40befb1 (diff) |
Slight refactor of ExternalFilesHelper:
-Make FileType and ExternalFileAction public.
-Have producers use ExternalFileAction, rather than a boolean, to specify the desired behavior.
And a big change in semantics (doesn't affect Bazel):
-Replace ExternalFileAction.ERROR_OUT with ExternalFileAction.ASSUME_NON_EXISTENT_AND_IMMUTABLE, which does what it sounds like. This new action, like the old ERROR_OUT, is _not_ used in Bazel.
--
MOS_MIGRATED_REVID=136063159
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/DirectoryListingStateFunction.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/DirectoryListingStateFunction.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/DirectoryListingStateFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/DirectoryListingStateFunction.java index aa1fe760e2..307c74b22a 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/DirectoryListingStateFunction.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/DirectoryListingStateFunction.java @@ -45,8 +45,10 @@ public class DirectoryListingStateFunction implements SkyFunction { return null; } return DirectoryListingStateValue.create(dirRootedPath); - } catch (FileOutsidePackageRootsException e) { - throw new DirectoryListingStateFunctionException(e); + } catch (ExternalFilesHelper.NonexistentImmutableExternalFileException e) { + // DirectoryListingStateValue.key assumes the path exists. This exception here is therefore + // indicative of a programming bug. + throw new IllegalStateException(dirRootedPath.toString(), e); } catch (IOException e) { throw new DirectoryListingStateFunctionException(e); } @@ -66,9 +68,5 @@ public class DirectoryListingStateFunction implements SkyFunction { public DirectoryListingStateFunctionException(IOException e) { super(e, Transience.TRANSIENT); } - - public DirectoryListingStateFunctionException(FileOutsidePackageRootsException e) { - super(e, Transience.PERSISTENT); - } } } |