Replace "" (empty string) default values of multiple options with "null".
This is preparation for turning on parsing of default values for multiple (allowMultiple = true) options.
This change is NOOP (enforced by OptionDefaultValueConversionTest#shouldConvertDefaultValue()) because for now default value of a multiple option does not matter and is always converted to an empty list. But it will matter a bit later: "null" - special value resolving to the same empty list, anything else - parsed by the converter.
RELNOTES: None.
PiperOrigin-RevId: 303345588
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java b/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java
index 218dd2d..a9a9aac 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java
@@ -71,18 +71,17 @@
public boolean enablePlatformSpecificConfig;
@Option(
- name = "config",
- defaultValue = "",
- documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
- effectTags = {OptionEffectTag.UNKNOWN},
- allowMultiple = true,
- help =
- "Selects additional config sections from the rc files; for every <command>, it "
- + "also pulls in the options from <command>:<config> if such a section exists; "
- + "if this section doesn't exist in any .rc file, Blaze fails with an error. "
- + "The config sections and flag combinations they are equivalent to are "
- + "located in the tools/*.blazerc config files."
- )
+ name = "config",
+ defaultValue = "null",
+ documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
+ effectTags = {OptionEffectTag.UNKNOWN},
+ allowMultiple = true,
+ help =
+ "Selects additional config sections from the rc files; for every <command>, it "
+ + "also pulls in the options from <command>:<config> if such a section exists; "
+ + "if this section doesn't exist in any .rc file, Blaze fails with an error. "
+ + "The config sections and flag combinations they are equivalent to are "
+ + "located in the tools/*.blazerc config files.")
public List<String> configs;
@Option(
@@ -206,7 +205,7 @@
@Option(
name = "build_metadata",
converter = AssignmentConverter.class,
- defaultValue = "",
+ defaultValue = "null",
allowMultiple = true,
documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
effectTags = {OptionEffectTag.TERMINAL_OUTPUT},
@@ -495,18 +494,17 @@
public ToolCommandLineEvent toolCommandLine;
@Option(
- name = "unconditional_warning",
- defaultValue = "",
- documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
- effectTags = {OptionEffectTag.TERMINAL_OUTPUT},
- allowMultiple = true,
- help =
- "A warning that will unconditionally get printed with build warnings and errors. This is "
- + "useful to deprecate bazelrc files or --config definitions. If the intent is to "
- + "effectively deprecate some flag or combination of flags, this is NOT sufficient. "
- + "The flag or flags should use the deprecationWarning field in the option definition, "
- + "or the bad combination should be checked for programmatically."
- )
+ name = "unconditional_warning",
+ defaultValue = "null",
+ documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
+ effectTags = {OptionEffectTag.TERMINAL_OUTPUT},
+ allowMultiple = true,
+ help =
+ "A warning that will unconditionally get printed with build warnings and errors. This is"
+ + " useful to deprecate bazelrc files or --config definitions. If the intent is to"
+ + " effectively deprecate some flag or combination of flags, this is NOT sufficient."
+ + " The flag or flags should use the deprecationWarning field in the option"
+ + " definition, or the bad combination should be checked for programmatically.")
public List<String> deprecationWarnings;
@Option(