[CALCITE-5875] Remove unnecessary NULL checks in Redis adapter#3339
Merged
Conversation
NobiGo
requested changes
Aug 1, 2023
|
|
||
| @AfterAll | ||
| public static void stopRedisContainer() { | ||
| if (REDIS_CONTAINER != null && REDIS_CONTAINER.isRunning()) { |
|
|
||
| @AfterEach | ||
| public void shutDown() { | ||
| if (null != pool) { |
Contributor
There was a problem hiding this comment.
I don't think so. When we init the pool throw exception, if, remove the condition, the code will throw NPE.
Member
Author
There was a problem hiding this comment.
@NobiGo Thanks for reviewing, sorry for my mistake, @AfterEach will still execute if @beforeeach fails. I have fixed it.
65e8801 to
5daae46
Compare
|
Kudos, SonarCloud Quality Gate passed! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.








What is the purpose of the change
code cleanup, remove some unnecessary null checks for redis adapter, because the static variable must be initialized successfully unless there is an exception.
Brief change log
Remove some unnecessary null checks in redis adapter.
Verifying this change
It's minor fix can be covered by current total cases.