Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SubscriptionsImportFragment: Inline setup stuff #10782

Conversation

Profpatsch
Copy link
Contributor

Very small simplification

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Due diligence

@AudricV AudricV added the codequality Improvements to the codebase to improve the code quality label Jan 23, 2024
Copy link

private List<SubscriptionExtractor.ContentSource> supportedSources;
private String relatedUrl;
private List<SubscriptionExtractor.ContentSource> supportedSources = Collections.emptyList();
private String relatedUrl = null;

Choose a reason for hiding this comment

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

I know this was originally set based on the function that was removed, but, if I recall correctly, a declared String in Java is already null, so this assignment is not needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably, but this just inlines the existing code, which I don’t want to change here.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah there's no problem in making it explicit that it's initialized to null

@Stypox
Copy link
Member

Stypox commented Mar 28, 2024

Sorry, I just realized that according to Android fragment lifecycle, the onCreate function might be called multiple times, so this PR actually does change semantics. I would not risk making this change right before the rewrite, as we want to ship as stable of a release as possible. However, it's true that the setupServiceVariables method could be inlined, but it's not too important, and will probably be rewritten sooner or later anyway.

@Stypox Stypox closed this Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codequality Improvements to the codebase to improve the code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants