diff options
author | 2016-03-11 17:36:29 +0000 | |
---|---|---|
committer | 2016-03-11 21:29:36 +0000 | |
commit | 7aa72a0a126c7fd6b54517b2a9f95b2cc6f1d50e (patch) | |
tree | 2907307d37d4f99af7dc9bded318a06676050f2c /src | |
parent | b82dba0ada05d8ba29b180d2ddbcaaaf7ce64a4a (diff) |
Improve error when allowedFileTypesForLabels is not set
--
MOS_MIGRATED_REVID=116980421
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/packages/Attribute.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/packages/Attribute.java b/src/main/java/com/google/devtools/build/lib/packages/Attribute.java index 1db5c46136..54ad8b073d 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/Attribute.java +++ b/src/main/java/com/google/devtools/build/lib/packages/Attribute.java @@ -829,9 +829,8 @@ public final class Attribute implements Comparable<Attribute> { if ((name.startsWith("$") || name.startsWith(":")) && allowedFileTypesForLabels == null) { allowedFileTypesForLabels = FileTypeSet.ANY_FILE; } - if (allowedFileTypesForLabels == null) { - throw new IllegalStateException(name); - } + Preconditions.checkNotNull( + allowedFileTypesForLabels, "allowedFileTypesForLabels not set for %s", name); } else if ((type == BuildType.OUTPUT) || (type == BuildType.OUTPUT_LIST)) { // TODO(bazel-team): Set the default to no file type and make explicit calls instead. if (allowedFileTypesForLabels == null) { |