aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/GraphBackedRecursivePackageProvider.java
diff options
context:
space:
mode:
authorGravatar Mark Schaller <mschaller@google.com>2015-03-23 14:27:26 +0000
committerGravatar Han-Wen Nienhuys <hanwen@google.com>2015-03-24 16:41:25 +0000
commit895b3d2b460351348dc7fd821d80f6e1bdf53f84 (patch)
tree46239508fe397c4de043fd962faf1a8a70b19b1f /src/main/java/com/google/devtools/build/lib/skyframe/GraphBackedRecursivePackageProvider.java
parentea3c254ae8f62fb090b9a2f6c5fa816ac99462ac (diff)
Preload the universe for query tests
This change means that tests no longer need to specify the patterns they use themselves, unless the test involves excluding some pattern. Also fixes a bug in GraphBackedRecursivePackageProvider revealed by the test changes where it behaved differently from EnvironmentBackedRecursivePackageProvider when looking up packages with errors. -- MOS_MIGRATED_REVID=89297008
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/GraphBackedRecursivePackageProvider.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/GraphBackedRecursivePackageProvider.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/GraphBackedRecursivePackageProvider.java b/src/main/java/com/google/devtools/build/lib/skyframe/GraphBackedRecursivePackageProvider.java
index 62f1e68400..0e12f07661 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/GraphBackedRecursivePackageProvider.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/GraphBackedRecursivePackageProvider.java
@@ -50,7 +50,13 @@ public final class GraphBackedRecursivePackageProvider implements RecursivePacka
if (graph.exists(pkgKey)) {
pkgValue = (PackageValue) graph.getValue(pkgKey);
if (pkgValue == null) {
- throw (NoSuchPackageException) Preconditions.checkNotNull(graph.getException(pkgKey));
+ NoSuchPackageException noSuchPackageException =
+ (NoSuchPackageException) Preconditions.checkNotNull(graph.getException(pkgKey), pkgKey);
+ Package pkg = noSuchPackageException.getPackage();
+ if (pkg == null) {
+ throw noSuchPackageException;
+ }
+ return pkg;
}
} else {
// If the package key does not exist in the graph, then it must not correspond to any package,