diff options
author | Carmi Grushko <carmi@google.com> | 2017-02-01 07:49:29 +0000 |
---|---|---|
committer | Yun Peng <pcloudy@google.com> | 2017-02-01 08:57:49 +0000 |
commit | bef4fbed3d22a976b895a3f75ad41699747c286e (patch) | |
tree | 47c4d589ab86d0a63eca302cdc51e9fa5bb26022 /src/main/java/com/google/devtools/build/lib/rules/proto/BazelProtoLibrary.java | |
parent | 28bf873a45e9787cbaa8dcffeedc4b98fa8fc2c2 (diff) |
Do not crash when a strict proto_library depends on a non-strict one.
(strictness in the sense of strict proto deps)
The reason for the crash was that a non-strict proto_library would put 'null' in its SupportData.protosInDirectDeps, and then a strict proto_library that consumes it would choke on the null. This rearranges things so that protosInDirectDeps will never be null.
--
PiperOrigin-RevId: 146210040
MOS_MIGRATED_REVID=146210040
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/proto/BazelProtoLibrary.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/proto/BazelProtoLibrary.java | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/proto/BazelProtoLibrary.java b/src/main/java/com/google/devtools/build/lib/rules/proto/BazelProtoLibrary.java index c97a746b06..562ee8703a 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/proto/BazelProtoLibrary.java +++ b/src/main/java/com/google/devtools/build/lib/rules/proto/BazelProtoLibrary.java @@ -16,7 +16,6 @@ package com.google.devtools.build.lib.rules.proto; import static com.google.devtools.build.lib.analysis.RuleConfiguredTarget.Mode.TARGET; import static com.google.devtools.build.lib.collect.nestedset.Order.STABLE_ORDER; -import static com.google.devtools.build.lib.rules.proto.ProtoCommon.areDepsStrict; import com.google.common.base.Predicates; import com.google.common.collect.ImmutableList; @@ -46,8 +45,7 @@ public class BazelProtoLibrary implements RuleConfiguredTargetFactory { NestedSet<Artifact> transitiveImports = ProtoCommon.collectTransitiveImports(ruleContext, protoSources); - NestedSet<Artifact> protosInDirectDeps = - areDepsStrict(ruleContext) ? ProtoCommon.computeProtosInDirectDeps(ruleContext) : null; + NestedSet<Artifact> protosInDirectDeps = ProtoCommon.computeProtosInDirectDeps(ruleContext); final SupportData supportData = SupportData.create( |