Skip to content

Prevent NPE in SessionConfig#equals. #625

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

Merged
merged 1 commit into from
Sep 6, 2019

Conversation

michael-simons
Copy link
Contributor

While SessionConfig.builder() disallows the user to input the literal value of nullas database name, the name is by default null and when not configured else, SessionConfig has literal null as value for the database.

Under this conditions, the equals method is broken and will throw an NPE in any case where the receiver of equals has no database name configured, i.e.:

SessionConfig.builder().build().equals( SessionConfig.builder().build())

This PR fixes the behaviour and adds tests.

@michael-simons michael-simons force-pushed the fix_sessionconfig_equals branch from 005a747 to 412097e Compare September 5, 2019 15:10
Copy link
Contributor

@zhenlineo zhenlineo left a comment

Choose a reason for hiding this comment

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

❤️

@zhenlineo zhenlineo merged commit 42925a6 into neo4j:4.0 Sep 6, 2019
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.

2 participants