-
-
Notifications
You must be signed in to change notification settings - Fork 441
Refactor to avoid possible null pointer dereference in YamlModelRepositoryImpl #4788
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
Conversation
return false; | ||
} | ||
|
||
List<JsonNode> removedNodes = e.getValue(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check that removedNodes
is not null before calling parseJsonNodesV1
. parseJsonNodesV1
expects a non nullable list as parameter.
It generates an error in Eclipse if not for a good reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a null check here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…itoryImpl Signed-off-by: Jimmy Tanagra <[email protected]>
Signed-off-by: Jimmy Tanagra <[email protected]>
Signed-off-by: Jimmy Tanagra <[email protected]>
68fb6ad
to
a459a79
Compare
rebased |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@Nadahar see f5f8921#r156317816
The compiler issued warnings about null type mismatch. There may be a small possibility that it would return null in case
modelCache
/model
is modified elsewhere perhaps. This refactor removes that possibility and as a result the compiler no longer has a warning about it.