History log of /external/desugar/java/com/google/devtools/common/options/IsolatedOptionsData.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
bf096ba935f132b5da0ad941f41897f7a7409fb3 14-Sep-2017 ccalvarin <ccalvarin@google.com> Consolidate the "unparsed" option value tracking.

In preparation for linking the parsed and unparsed values of options, consolidate and standardize our representation of the flag values as we received them (what is meant by "unparsed" values in this case). This was being done separately in ParseOptionResult, which, with extra context added, is being folded into UnparsedOptionValueDescription. We now track how an option was provided and where it came from for all option parsing.

RELNOTES: None.
PiperOrigin-RevId: 168682082
GitOrigin-RevId: 5fe8e6629e09ce44c6835d1b8f3a36bc3d69f131
Change-Id: I3964b563289ee39ab3a9a7ac496ed033459546c0
/external/desugar/java/com/google/devtools/common/options/IsolatedOptionsData.java
791d192ce568d516ec0863ff5b89f49f7e1423bf 08-Sep-2017 ccalvarin <ccalvarin@google.com> Options with oldNames will no longer get reported twice in the effective option lists.

Tracking the names together for option identification was useful, but then the same list was being used as the source of options for the parser, which lead to some options being listed twice.

Also complete a few tests that should have already been tested in different orders.

PiperOrigin-RevId: 168024719
GitOrigin-RevId: 80399bc14ced39936ef19a20f3b8c2d1536aa6c2
Change-Id: Id2d7edfcace3f21b9ed4997fc9b94e4c39731a4a
/external/desugar/java/com/google/devtools/common/options/IsolatedOptionsData.java
5ea845dbe3e0e066f5de1577adcd7a0a3e71f7e9 31-Aug-2017 ccalvarin <ccalvarin@google.com> Move final static option checks to compile time.

Check that the option has a non-empty name and that it does not use deprecated categories. While we're at it, check that the names for options that are flags (all but INTERNAL flags, which are not meant to be used on the command line) are sensible.

PiperOrigin-RevId: 167182172
GitOrigin-RevId: 7c953bfae9d650813b2fe6ab934cbac5db1497ba
Change-Id: I95ad838156720d06cece0b0682653d1f148375ed
/external/desugar/java/com/google/devtools/common/options/IsolatedOptionsData.java
e84b17f3ad086a72068d5c185d99e1c0364458da 31-Aug-2017 ccalvarin <ccalvarin@google.com> Move caching of OptionDefinitions to be static, and remove uncached extractions of OptionDefinitions.

We already had caching of OptionsData objects, for a list of OptionsBases, but repeated the reflective work for the same OptionsBase if it appeared in different lists. Now that the @Option-annotation specific state is isolated to the OptionDefinition object, this can be trivially cached by OptionsBase.

There are a few additional convenient side effects to this change. This should slightly decrease the memory use of the OptionsParser, since it already cached this map per options-base, and now only requires a single copy. It also means that parts of the code base that needed details of an option's definition no longer need to either obtain an option definition themselves or need access to an OptionsData object, which should be private to the OptionsParser anyway.

PiperOrigin-RevId: 167158902
GitOrigin-RevId: 987f09f0cf3c5bf2fc5157c20fe0f7979978a40b
Change-Id: I5ceeb8e2b12215f5702a8731b9a94b97bd48792a
/external/desugar/java/com/google/devtools/common/options/IsolatedOptionsData.java
d862ad355b5c16ac8956a506853c6f0a0a1a3759 31-Aug-2017 ccalvarin <ccalvarin@google.com> Move static converter legality checks to compile time.

The information about whether a converter correctly matches the type of option it is meant to convert strings to is available at compile time. There is no reason to do this check at runtime.

Now, for an option to compile, it will need to have a converter that matches the option's type, taking into account whether the option is expected to accumulate multiple values. If it does not specify its own converter, a matching converter in the Converters.DEFAULT_CONVERTER list must be found, and the default value provided must be parseable by the matching default converter.

Remove tests that were testing failure modes which no longer compile.

RELNOTES: None.
PiperOrigin-RevId: 167092773
GitOrigin-RevId: 3e44d5b0de694632ac802c81838063d7f8563998
Change-Id: Ia5b5e462353f070276c311247758dba3a28be16a
/external/desugar/java/com/google/devtools/common/options/IsolatedOptionsData.java
f317207148cc37de89df67aae4ab5b5efc354d49 30-Aug-2017 ccalvarin <ccalvarin@google.com> Move default value & converter finding logic to the OptionDefinition class.

Removes some duplicate computation by memoizing the results. Consolidates caching into a single optionDefinition object, instead of having multiple caches that go from the option name to different parts of what defines an option.

Fly-by cleanup of OptionDescription's contents, all contents that are statically defined as part of an option are in OptionDefintion, while expansion data, which depends on the existence of other options, is more clearly stored separately.

Will move the converter-to-option type matching sanity checks to a compile time check in a later change.

RELNOTES: None.
PiperOrigin-RevId: 166912716
GitOrigin-RevId: 00443495e002c9fc68adbcb708f223eb4b6a73c1
Change-Id: If3915782a59d520353f3e5daeb4e489484a3307c
/external/desugar/java/com/google/devtools/common/options/IsolatedOptionsData.java
132d0eabba9cedbd8297e36a61fc24c1cce7a4ce 24-Aug-2017 ccalvarin <ccalvarin@google.com> Move option tag checks to compile time.

The rationality checks failed as RuntimeExceptions that weren't getting reported properly because the options parser is created too early in Bazel's lifetime to be reported properly to standard error. This was a minor annoyance for authors of new options, and there was nothing gained by waiting until runtime to check these values.

RELNOTES: None
PiperOrigin-RevId: 166395759
GitOrigin-RevId: 41f2974d50aaafe713d938866ee17b03c58bec00
Change-Id: I90393753c7cc58020a515dc510cfdf8046e4c0a3
/external/desugar/java/com/google/devtools/common/options/IsolatedOptionsData.java
dfb8518e3845f1dbdd1b7dfada2e682c9dff6b02 22-Aug-2017 ccalvarin <ccalvarin@google.com> Add OptionDefinition layer between the @Option annotation and its fields and the options parser.

Removes any direct reads of the annotation outside of OptionDefinition. This allows for fewer manual checks for the annotation's existence, unifies error wording, and paves the way for potentially generifying the OptionsParser to accept different @Option-equivalent annotations.

Also allows for cleanup of duplicate code by giving @Option-specific operations a clear home, such as sorts and default logic. In followup changes, we can eliminate some unnecessarily complex caching by instead memoizing values in the OptionDefinition. This will have the positive side effect of making sure reads come from the cached values.

RELNOTES: None.
PiperOrigin-RevId: 166019075
GitOrigin-RevId: e8aae03888a44ee8d5264c3d8f6b3adaeb830df5
Change-Id: Ie5ffe0c1983e89885a2bfcab8cf7565790f396fd
/external/desugar/java/com/google/devtools/common/options/IsolatedOptionsData.java
0f0fc0eb1b25a355e22858e54ecf77c6007a5bc6 16-Aug-2017 ccalvarin <ccalvarin@google.com> 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
GitOrigin-RevId: c69dbf8ed4893066d0474f87c0a8ddae00e4ee58
Change-Id: Iba12221dbcf759ab090c3c66509c89055e820fd1
/external/desugar/java/com/google/devtools/common/options/IsolatedOptionsData.java
0df7843c43d47beed440cc97d72cb283595b91a9 17-Jul-2017 ccalvarin <ccalvarin@google.com> Make the @Option annotation depend on the java version of the tagging enums.

The option filters proto dependency can be removed from the OptionsParser. This is in response to option parser users that want to avoid the bazel-internal proto file in their dependencies.

RELNOTES: None.
PiperOrigin-RevId: 162249778
GitOrigin-RevId: c82a19714dac1210654640ac1f5ca4d96df716a8
Change-Id: If5368c1d0c8ec90d2f07489c742aef53e13ce046
/external/desugar/java/com/google/devtools/common/options/IsolatedOptionsData.java
6a534d36fc7ecb610492c1102754c7f24228260a 11-Jul-2017 ccalvarin <ccalvarin@google.com> Fold OptionUsageRestrictions into OptionDocumentationCategory and OptionMetadataTags.

These are similar, no need to have both fields. Removing the "DOCUMENTED" default, the absence of UNDOCUMENTED will be used instead.

Since requiring a documentation category for undocumented options doesn't make sense, list that as one of the OptionDocumentationCategories, but list HIDDEN and INTERNAL as part of OptionMetadata. These options should list UNDOCUMENTED as their category.

PiperOrigin-RevId: 161515674
GitOrigin-RevId: 456adb2267343a4e2e64f082e77169c18f9e6060
Change-Id: Ia7dcbd5d38d4caa2d6d60f25b5a1f0c23735ca22
/external/desugar/java/com/google/devtools/common/options/IsolatedOptionsData.java
1431fe6bc72f2003c205ef999ab83e0dbd2cb4da 30-Jun-2017 ccalvarin <ccalvarin@google.com> Enforce the new category and effect tags.

All options need to explicitly list their category and effect. If they are uncategorized, this makes the lack of information obvious. Remove defaults from the annotation to enforce this.

Also enforce the sanity check that no option should have UNKNOWN or NO_OP effects listed with other effect tags.

Includes some last default sets for options I missed in the previous mass-setting change, and some that were added since.

PiperOrigin-RevId: 160641861
GitOrigin-RevId: 59a0e4f10bf037dcd4f257b2e21573fa1b690e93
Change-Id: Ia4d56acf71a4805df60d177e5525a9f7c180225b
/external/desugar/java/com/google/devtools/common/options/IsolatedOptionsData.java
22bfa1035cadd8f4ec305a72028e9aecb7cee0bd 07-Jun-2017 ccalvarin <ccalvarin@google.com> Require that flags with static expansions be of Void type.

The type was ignored, and it was expected that all expansion flags had
no value of their own, but was not checked.

PiperOrigin-RevId: 158261788
GitOrigin-RevId: 987715b2e18a5c0ebc5e3174bbba2b66e5d406a9
Change-Id: Ie52d562c84bb4c3be85562bf70bdd5b9429c857d
/external/desugar/java/com/google/devtools/common/options/IsolatedOptionsData.java
3dfc32e3fc40ec125c08b71a8c194b5ab7e725c4 31-May-2017 ccalvarin <ccalvarin@google.com> Remove support of --no_ prefix for boolean flags.

The no_ prefix was initially undocumented, but its support has over time
lead to a number of inconsistencies.

RELNOTES: --no_ prefix no longer recognized.
PiperOrigin-RevId: 157631435
GitOrigin-RevId: ca600bf2d014650b1f1ecb5214878b09a0838086
Change-Id: I2fb139e544049b153ab5a154a96f438e6d63d3e8
/external/desugar/java/com/google/devtools/common/options/IsolatedOptionsData.java
a2cdb759c1a831b73e27cff4c672bd234c58b4b3 26-Apr-2017 brandjon <brandjon@google.com> Add a way for options classes to mark that they are skyframe-friendly

You can now use the annotation @UsesOnlyCoreTypes on a subclass of OptionsBase, to indicate that all of its options' types are restricted to a whitelist of immutable and serializable types. Subclasses of the annotated class must also follow the same restriction.

RELNOTES: None
PiperOrigin-RevId: 154328920
GitOrigin-RevId: 46da1fca1b3b0b4cd4eb28c4ec4f3cb1b5a22dd4
Change-Id: I1f694a8a4a18646a0d39832b5c0e01f5bfb154cd
/external/desugar/java/com/google/devtools/common/options/IsolatedOptionsData.java
e9535994a47759cb1a280e2581200268990f6511 19-Apr-2017 ccalvarin <ccalvarin@google.com> Don't hard remove --no_, give a warning first.

PiperOrigin-RevId: 153610163
GitOrigin-RevId: f9efa42113c5bcf0aaadb73fbc3822b389cc5c96
Change-Id: Id19ba95070a42d783154732bbd50daa9d147d440
/external/desugar/java/com/google/devtools/common/options/IsolatedOptionsData.java
da7c4fbacb562739ea057664a7caca3865edc954 19-Apr-2017 ccalvarin <ccalvarin@google.com> Deprecate use of option category to describe documentation level / usage restrictions.

Prevent the old category strings "undocumented," "hidden," or "internal" from being used as categories, to prevent developers from relying on deprecated behavior.

PiperOrigin-RevId: 153525499
GitOrigin-RevId: 5d1042629e94e278dcc49db5f640829acc3bff1a
Change-Id: I64cbb532e4bf98c98bd2bd7a6842af4737941d54
/external/desugar/java/com/google/devtools/common/options/IsolatedOptionsData.java
95c1d277f60c780719e878d9bdadf19800ab245a 17-Apr-2017 brandjon <brandjon@google.com> Add ordering semantics for cached options data

This lets us easily get all options classes of a parser, or all fields of those options classes, in a deterministic way.

RELNOTES: None
PiperOrigin-RevId: 153376699
GitOrigin-RevId: 91e4dedd402c214a815eb6e2290998dec1f3d397
Change-Id: I9570bd2389ff177f014b86928bcb3194f3175049
/external/desugar/java/com/google/devtools/common/options/IsolatedOptionsData.java
56aed98f5142edf98cec7419a48e47a6c8bf9fb6 07-Apr-2017 ccalvarin <ccalvarin@google.com> Remove --no_ support.

--no_ prefixes for boolean flags are deprecated. Error out nicely if --no_ is supplied.
PiperOrigin-RevId: 152434290
GitOrigin-RevId: 681f433545a22c8169bed8643fee560f3b500607
Change-Id: I3cd83e889daedf3c7964bd0b0a1bc62f7ad71cee
/external/desugar/java/com/google/devtools/common/options/IsolatedOptionsData.java
f38a695a98e39b6521181a9bc7cae3e9c60985a3 31-Mar-2017 brandjon <brandjon@google.com> Add --all_incompatible_changes, the user's shorthand for turning on all --incompatible_* flags

Note that if a developer adds a poorly-formatted incompatible change @Option, constructing an OptionsParser will now fail with an unchecked exception. This can cause some unit tests to fail in unexpected ways, but the developer should see an appropriate error message when the server starts up.

To be added: A separate integration test that ensures the expansions of --all_incompatible_changes don't clobber each other.

RELNOTES: None

PiperOrigin-RevId: 151858287

GitOrigin-RevId: 94261751bf2babe093696c35208e09768e3fd05e
Change-Id: I5015de1359d7025a46cb4f5296cb246e0b280f38
/external/desugar/java/com/google/devtools/common/options/IsolatedOptionsData.java
2b34eda74c90a35642da755247164bbebf69b191 30-Mar-2017 ccalvarin <ccalvarin@google.com> Watch for --no and --no_ flag name conflicts.

Prevent OptionsBases with conflicting names due to --no boolean flag aliases to
successfully combine into parser.

Also remove the comment about --no_ not being documented, since it has been documented since Bazel was open-sourced.

PiperOrigin-RevId: 151738453

GitOrigin-RevId: 584dc717e64df4e50d7f657eb2878f53295eab12
Change-Id: I9c7bf47ac2135df2626ce80e4b9e82500f1d5f53
/external/desugar/java/com/google/devtools/common/options/IsolatedOptionsData.java
172122c125f4b4b3eb402b0d5606a7862a28fd47 22-Mar-2017 Jon Brandvein <brandjon@google.com> Add expansion functions to options parser

This provides a way to programmatically define expansions of options based on what other options are defined for the parser. In particular, it will be used for the --incompatible_* changes mechanism, to turn on all incompatible change flags.

Expansion functions are specified in the @Option annotation, similar to converters. They are computed when an OptionsParser is constructed, and inspect a preliminary version of its OptionsData to determine the expansion result. This is then cached in the final OptionsData used by the parser.

Expansion information for usage strings is available, but only when the usage strings are obtained via the parser.

--
PiperOrigin-RevId: 150817553
MOS_MIGRATED_REVID=150817553

GitOrigin-RevId: 22d261c21748fba31797f0de8bd98fb2ff2fd2f5
Change-Id: Iec0d628fbf873b2b3d7fb7f4c86ad809f9955dbb
/external/desugar/java/com/google/devtools/common/options/IsolatedOptionsData.java