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

Cleanup layoutManager null-check when AbstractZkLedgerManagerFactory#newLedgerManagerFactory #4124

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AnonHxy
Copy link
Contributor

@AnonHxy AnonHxy commented Nov 3, 2023

Descriptions of the changes in this PR:

Motivation

Remove the null-check from AbstractZkLedgerManagerFactory#newLedgerManagerFactory. The reason is that:

  1. the parameter layoutManager in newLedgerManagerFactory() method can never be null. So this check is unnecessory
  2. If the layoutManager is null and we return new FlatLedgerManagerFactory().initialize(conf, null, FlatLedgerManagerFactory.CUR_VERSION), the 'zk' in FlatLedgerManagerFactory is null and could throw NPE when invoke the methods in the FlatLedgerManagerFactory.

Changes

  1. Cleanup layoutManager null-check when newLedgerManagerFactory()
  2. Let layoutManager could never be null in FlatLedgerManagerFactory

@AnonHxy
Copy link
Contributor Author

AnonHxy commented Nov 4, 2023

rerun failure checks

3 similar comments
@AnonHxy
Copy link
Contributor Author

AnonHxy commented Nov 4, 2023

rerun failure checks

@AnonHxy
Copy link
Contributor Author

AnonHxy commented Nov 11, 2023

rerun failure checks

@AnonHxy
Copy link
Contributor Author

AnonHxy commented Nov 13, 2023

rerun failure checks

@AnonHxy AnonHxy closed this Nov 14, 2023
@AnonHxy AnonHxy reopened this Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant