diff options
author | ccalvarin <ccalvarin@google.com> | 2017-11-22 10:04:04 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2017-11-22 10:06:21 -0800 |
commit | d55acc31ec7c731481a3691e6cf91c53869e9c67 (patch) | |
tree | d9453f5566fac6477e37592b7a700ae0a812e46a /src/main/java/com/google/devtools/common | |
parent | d420f6f4ea4c254eb26ffeef1b21dd380aad8b21 (diff) |
Fix canonical option list for options that implicitly require options with allowMultiple=true
Was filtering for the implicit options in SingleOptionValue, but forgot the check in RepeatableOptionValue. This is now fixed.
RELNOTES: None.
PiperOrigin-RevId: 176669853
Diffstat (limited to 'src/main/java/com/google/devtools/common')
-rw-r--r-- | src/main/java/com/google/devtools/common/options/OptionValueDescription.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/common/options/OptionValueDescription.java b/src/main/java/com/google/devtools/common/options/OptionValueDescription.java index bb6f24266d..616b3b58c8 100644 --- a/src/main/java/com/google/devtools/common/options/OptionValueDescription.java +++ b/src/main/java/com/google/devtools/common/options/OptionValueDescription.java @@ -276,8 +276,10 @@ public abstract class OptionValueDescription { public String getSourceString() { return parsedOptions .asMap() - .values() + .entrySet() .stream() + .sorted(Comparator.comparing(Entry::getKey)) + .map(Entry::getValue) .flatMap(Collection::stream) .map(ParsedOptionDescription::getSource) .distinct() @@ -323,6 +325,8 @@ public abstract class OptionValueDescription { .sorted(Comparator.comparing(Entry::getKey)) .map(Entry::getValue) .flatMap(Collection::stream) + // Only provide the options that aren't implied elsewhere. + .filter(optionDesc -> optionDesc.getImplicitDependent() == null) .collect(ImmutableList.toImmutableList()); } } |