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

Fix merge of AddonInfo (masterAddonInfo field) #4309

Merged
merged 1 commit into from
Jul 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ public void removeAddonInfoProvider(AddonInfoProvider addonInfoProvider) {
builder.withName(b.getName());
builder.withDescription(b.getDescription());
}
if (!(a.isMasterAddonInfo() || b.isMasterAddonInfo())) {
builder.isMasterAddonInfo(false);
if (!a.isMasterAddonInfo() && b.isMasterAddonInfo()) {
builder.isMasterAddonInfo(true);
Comment on lines +109 to +110
Copy link
Member

Choose a reason for hiding this comment

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

Why is it important that a is not masterAddonInfo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just to avoid the useless call to builder.isMasterAddonInfo when the builder value is already set to true, and have a similar pattern as the remaining in that method.

But could also be done differently by replacing the full if then block by just:
builder.isMasterAddonInfo(a.isMasterAddonInfo() || b.isMasterAddonInfo()};

}
if (a.getConnection() == null && b.getConnection() != null) {
builder.withConnection(b.getConnection());
Expand Down