-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify TargetRecorder API for disabling name conflict checking
Name conflict checking is disabled for package deserialization but enabled in all other contexts where we are building a `Package` object. Previously, this disabling was done by a stateful mutation on the `Package.Builder`, with associated precondition checks to confirm that this mutation did or did not occur before calling certain methods, and that this mutation was only attempted at most once. This is a bit convoluted and is the result of my original attempt to understand `Package.Builder`'s sprawling API (now part of `TargetRecorder`). It's clear though that this can be better expressed as a constructor arg, removing the need for the extra consistency checking. Also updated some javadoc to remove mention of fields being nullified after package construction -- that was removed in 8977891. The field `macroNamespaceViolatingTargets` is also now never null -- even during package deserialization it still eventually gets a value due to the `putAll...()` method, so we may as well initialize it to a collection object. With these changes, the fields in question are now able to be marked `final`. Drive-by cleanup during #19922. PiperOrigin-RevId: 681065954 Change-Id: I060ae2fbaca9589ed95a45568127538a6aafe537
- Loading branch information
1 parent
bca3fd7
commit 5223379
Showing
5 changed files
with
69 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters