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 owner selection logic in table create #525

Merged
merged 1 commit into from
Jan 25, 2023
Merged

Conversation

swaranga-netflix
Copy link
Contributor

No description provided.

@swaranga-netflix swaranga-netflix marked this pull request as ready for review January 24, 2023 23:51
return Optional.ofNullable(definitionMetadata)
.map(definitionMetadataJson -> definitionMetadataJson.get("owner"))
.map(ownerJson -> ownerJson.get("userId"))
.map(JsonNode::textValue);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the orElse(null) no longer needed here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The method returns an Optional to signal to the callers that this can be null. Hence the orElse is only needed at the call-site.

@swaranga-netflix swaranga-netflix merged commit 0ef3420 into master Jan 25, 2023
@swaranga-netflix swaranga-netflix deleted the fix-owner branch January 25, 2023 07:07
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.

3 participants