diff options
author | 2017-08-16 03:03:49 +0200 | |
---|---|---|
committer | 2017-08-16 11:06:42 +0200 | |
commit | c69dbf8ed4893066d0474f87c0a8ddae00e4ee58 (patch) | |
tree | d81448d4be5a02360502c1939f884ea3503105d4 /src/main/java/com/google/devtools/common/options/OptionsParserImpl.java | |
parent | 59f1d889f71d6d203ca061787d4ea16465df1916 (diff) |
Use cached values for option converter types.
This requires us to have OptionsData for all usage messages, since static functionality is being removed, but this should already have been the case. It was added as an optional argument when the expansion function feature was added, but there is actually no reason not to require it, as the public interface for usage text was already computing the optionsData anyway.
PiperOrigin-RevId: 165386893
Diffstat (limited to 'src/main/java/com/google/devtools/common/options/OptionsParserImpl.java')
-rw-r--r-- | src/main/java/com/google/devtools/common/options/OptionsParserImpl.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/common/options/OptionsParserImpl.java b/src/main/java/com/google/devtools/common/options/OptionsParserImpl.java index 5ebd4a59cf..49d15473ea 100644 --- a/src/main/java/com/google/devtools/common/options/OptionsParserImpl.java +++ b/src/main/java/com/google/devtools/common/options/OptionsParserImpl.java @@ -624,7 +624,7 @@ class OptionsParserImpl { booleanValue = false; if (field != null) { // TODO(bazel-team): Add tests for these cases. - if (!OptionsData.isBooleanField(field)) { + if (!optionsData.isBooleanField(field)) { throw new OptionsParsingException( "Illegal use of 'no' prefix on non-boolean option: " + arg, arg); } @@ -650,7 +650,7 @@ class OptionsParserImpl { if (value == null) { // Special-case boolean to supply value based on presence of "no" prefix. - if (OptionsData.isBooleanField(field)) { + if (optionsData.isBooleanField(field)) { value = booleanValue ? "1" : "0"; } else if (field.getType().equals(Void.class) && !option.wrapperOption()) { // This is expected, Void type options have no args (unless they're wrapper options). |