summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorccalvarin <ccalvarin@google.com>2017-09-21 01:33:27 +0200
committerIvan Gavrilovic <gavra@google.com>2017-09-22 23:29:11 +0100
commit55cf690e724bfc6ef5bd22ae8dccf4737f5c05c2 (patch)
tree17534cd34916aae1f441667b45c12ea51330a2e7 /java
parent2c366b859ba2c84184e38450786e33368c9c39c2 (diff)
downloaddesugar-55cf690e724bfc6ef5bd22ae8dccf4737f5c05c2.tar.gz
Track all option instances.
Regardless of option type, have the OptionValueDescription track information about the parsed option. This does not yet change the values that we output as part of the GotOptionsEvent, as the expansion, implicit req, and wrapper options still don't actually track anything in their option value. RELNOTES: None. PiperOrigin-RevId: 169469793 GitOrigin-RevId: 1ad38ea0dd4eb10cad92daf0fb2710ff118147c9 Change-Id: If2f29862ffabb190cbb9fcdc1a56685fa2916a5e
Diffstat (limited to 'java')
-rw-r--r--java/com/google/devtools/common/options/OptionsParserImpl.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/java/com/google/devtools/common/options/OptionsParserImpl.java b/java/com/google/devtools/common/options/OptionsParserImpl.java
index d3a3751..a7745f6 100644
--- a/java/com/google/devtools/common/options/OptionsParserImpl.java
+++ b/java/com/google/devtools/common/options/OptionsParserImpl.java
@@ -341,8 +341,15 @@ class OptionsParserImpl {
OptionDefinition optionDefinition = parsedOption.getOptionDefinition();
// All options can be deprecated; check and warn before doing any option-type specific work.
maybeAddDeprecationWarning(optionDefinition);
- @Nullable String unconvertedValue = parsedOption.getUnconvertedValue();
+ // Track the value, before any remaining option-type specific work that is done outside of
+ // the OptionValueDescription.
+ OptionValueDescription entry =
+ optionValues.computeIfAbsent(
+ optionDefinition, OptionValueDescription::createOptionValueDescription);
+ entry.addOptionInstance(parsedOption, implicitDependent, expandedFrom, warnings);
+
+ @Nullable String unconvertedValue = parsedOption.getUnconvertedValue();
if (optionDefinition.isWrapperOption()) {
if (unconvertedValue.startsWith("-")) {
String sourceMessage =
@@ -414,11 +421,6 @@ class OptionsParserImpl {
+ ": "
+ Joiner.on(' ').join(unparsed));
}
- } else {
- OptionValueDescription entry =
- optionValues.computeIfAbsent(
- optionDefinition, OptionValueDescription::createOptionValueDescription);
- entry.addOptionInstance(parsedOption, implicitDependent, expandedFrom, warnings);
}
// Collect any implicit requirements.