Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@matanlurey
Copy link
Contributor

All of these are non-semantics changing and all were auto-applied by IntelliJ:

  • Make always final stuff final
  • Avoid unnecessary casts
  • Annotate @NonNull overrides
  • Avoid initializing callbacks outside of the constructor, and use Java lambdas when applicable
  • Avoid cases where something is known to be non-null or non-false
  • Use <> when applicable

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@matanlurey matanlurey force-pushed the engine-android-cleanup-FlutterRenderer branch from c4077dd to 1f4eaf6 Compare January 9, 2024 23:31
waitOnFence(image);
return;
}
if (!ignoringFence) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened here?

The instance starts with "ignoringFence = false" and this check is to ensure we only log the message once.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 584 says:

if (ignoringFence) {
  return;
}

So in what case will if (ignoringFence) hold on line 592? Maybe I'm missing something subtle about multi-threaded access?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doh! I missed that if at the top. Sorry for the noise.

// callback may still be called by a stale reference after released==true and
// mNativeView==null.
SurfaceTexture.OnFrameAvailableListener onFrameListener =
texture -> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No action necessary: This is some wild syntax to me. I prefer the original as it actually lists the method name we are overloading- how does this syntax work when an interface has more than one method? I guess it doesn't work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get it. I'd be open to reverting back to the previous syntax, but I think the point is there is only a single method (and the Java standard is moving towards lambdas for single-method overloads).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine going with the flow.

@matanlurey matanlurey merged commit e57e418 into flutter:main Jan 10, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants