Replace RenderBox.compute* with RenderBox.get* and add @visibleForOverriding#145503
Merged
auto-submit[bot] merged 7 commits intoflutter:masterfrom Mar 22, 2024
Merged
Conversation
1fb4212 to
9313411
Compare
RenderBox.compute* with RenderBox.get* and enforce it in the frameworkRenderBox.compute* with RenderBox.get* and add @visibleForOverriding
ffb572a to
0a4d005
Compare
goderbauer
approved these changes
Mar 21, 2024
Member
goderbauer
left a comment
There was a problem hiding this comment.
LGTM
Looks like we had more violations than expected...
| for (final MapEntry<ResolvedUnitResult, List<(AstNode, String)>> entry in _errors.entries) | ||
| for (final (AstNode node, String suggestion) in entry.value) | ||
| '${locationInFile(entry.key, node, workingDirectory)}: ${node.parent}. Consider calling $suggestion instead.', | ||
| '\n${bold}Typically the get* methods should be used to compute the intrinsics of a RenderBox.$reset', |
Member
There was a problem hiding this comment.
Maybe: compute -> obtain? (It sounds odd to say don't use the compute* methods to compute the thing)
Comment on lines
+66
to
+69
| // Framework naming convention: a RenderObject subclass names have "Render" in its name. | ||
| if (!interfaceElement.name.contains('Render')) { | ||
| return false; | ||
| } |
Member
There was a problem hiding this comment.
Why this shortcut? Can we not just check if it inherits from RenderBox?
Contributor
Author
There was a problem hiding this comment.
The only way I found for checking the "implements" relationship is to traverse the subclass hierarchy so it's a small optimization to reduce the number of branches to check.
Contributor
|
auto label is removed for flutter/flutter/145503, due to - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label. |
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Mar 22, 2024
…visibleForOverriding` (flutter/flutter#145503)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Mar 22, 2024
…visibleForOverriding` (flutter/flutter#145503)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Mar 22, 2024
…visibleForOverriding` (flutter/flutter#145503)
camsim99
pushed a commit
to flutter/packages
that referenced
this pull request
Mar 25, 2024
flutter/flutter@18340ea...14774b9 2024-03-22 [email protected] Roll Flutter Engine from eba6e31498b8 to 09dadce76828 (1 revision) (flutter/flutter#145603) 2024-03-22 [email protected] Roll Flutter Engine from f9a34ae0b14f to eba6e31498b8 (1 revision) (flutter/flutter#145598) 2024-03-22 [email protected] Intensive `if` chain refactoring (flutter/flutter#145194) 2024-03-22 [email protected] Adds numpad navigation shortcuts for Linux (flutter/flutter#145464) 2024-03-22 [email protected] Roll Flutter Engine from 5a12de1beab7 to f9a34ae0b14f (1 revision) (flutter/flutter#145581) 2024-03-22 [email protected] Roll Flutter Engine from e2f324beac3b to 5a12de1beab7 (1 revision) (flutter/flutter#145578) 2024-03-22 [email protected] Replace `RenderBox.compute*` with `RenderBox.get*` and add `@visibleForOverriding` (flutter/flutter#145503) 2024-03-22 [email protected] Add some cross references in the docs, move an example to a dartpad example (flutter/flutter#145571) 2024-03-22 [email protected] Fix `BorderSide.none` requiring explicit transparent color for `UnderlineInputBorder` (flutter/flutter#145329) 2024-03-22 [email protected] Roll Flutter Engine from a46a7b273a5b to e2f324beac3b (1 revision) (flutter/flutter#145576) 2024-03-21 [email protected] Fix nullability of getFullHeightForCaret (flutter/flutter#145554) 2024-03-21 [email protected] Add a `--no-gradle-generation` mode to the `generate_gradle_lockfiles.dart` script (flutter/flutter#145568) 2024-03-21 [email protected] Roll Flutter Engine from 1b842ae58b3d to a46a7b273a5b (2 revisions) (flutter/flutter#145569) 2024-03-21 [email protected] Fixed race condition in PollingDeviceDiscovery. (flutter/flutter#145506) 2024-03-21 [email protected] Roll Flutter Engine from a2ed373fa70f to 1b842ae58b3d (1 revision) (flutter/flutter#145565) 2024-03-21 [email protected] Clarify AutomaticKeepAliveClientMixin semantics in build method (flutter/flutter#145297) 2024-03-21 [email protected] Eliminate more window singleton usages (flutter/flutter#145560) 2024-03-21 [email protected] `flutter test --wasm` support (flutter/flutter#145347) 2024-03-21 [email protected] Roll Flutter Engine from eb262e9c34db to a2ed373fa70f (2 revisions) (flutter/flutter#145556) 2024-03-21 [email protected] Roll Flutter Engine from bad4a30e1c75 to eb262e9c34db (1 revision) (flutter/flutter#145555) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
May 14, 2024
…visibleForOverriding` (flutter/flutter#145503)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@visibleForOverriding+@protectedunfortunately does not catch the case where acompute*method was overridden in a subtype and the overide was called in that same type's implementation.I did not add a
flutter_ignorefor this because it doesn't seem there will be false positives.Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.