diff options
author | ccalvarin <ccalvarin@google.com> | 2017-11-22 10:04:04 -0800 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2017-11-29 11:28:47 -0800 |
commit | d89c817fb039277ae1fab05da63e5255f136e032 (patch) | |
tree | 04ea78ba6c6c9a719f7629387081990e1d6ae3a3 | |
parent | 064a5454e314c9a3ec52a58fa57d66f3dd82e827 (diff) | |
download | desugar-d89c817fb039277ae1fab05da63e5255f136e032.tar.gz |
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
GitOrigin-RevId: d55acc31ec7c731481a3691e6cf91c53869e9c67
Change-Id: I22d16447e5ad977ec890008e25be4d396a2523ed
-rw-r--r-- | java/com/google/devtools/common/options/OptionValueDescription.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/java/com/google/devtools/common/options/OptionValueDescription.java b/java/com/google/devtools/common/options/OptionValueDescription.java index bb6f242..616b3b5 100644 --- a/java/com/google/devtools/common/options/OptionValueDescription.java +++ b/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()); } } |