Skip to content

Return emptySet or emptyList instead of null to honor contract for re…#398

Merged
ok2c merged 1 commit intoapache:5.3.xfrom
sandeepnkulkarni:return-emptyset-instead-of-null
Mar 27, 2023
Merged

Return emptySet or emptyList instead of null to honor contract for re…#398
ok2c merged 1 commit intoapache:5.3.xfrom
sandeepnkulkarni:return-emptyset-instead-of-null

Conversation

@sandeepnkulkarni
Copy link
Copy Markdown
Contributor

…turn type

@garydgregory
Copy link
Copy Markdown
Member

Should the collection returned be editable?

@sandeepnkulkarni
Copy link
Copy Markdown
Contributor Author

sandeepnkulkarni commented Mar 19, 2023

Majority of the changes proposed here are around method getTrailerNames() in EntityDetails interface.

There are many places where we are already returning immutable collection i.e. emptySet for implementation of this method. I believe that is what is correct. But few places were returning null. This PR fixes those issues.

@ok2c
Copy link
Copy Markdown
Member

ok2c commented Mar 23, 2023

@sandeepnkulkarni Please change the target branch to 5.3.x.

@sandeepnkulkarni sandeepnkulkarni changed the base branch from master to 5.3.x March 23, 2023 14:14
@ok2c ok2c merged commit 81e3b84 into apache:5.3.x Mar 27, 2023
@sandeepnkulkarni sandeepnkulkarni deleted the return-emptyset-instead-of-null branch March 27, 2023 15:18
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