FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GH-139: [Flight] Stop return null from MetadataAdapter.getAll(String) and getAllByte(String) by axreldable · Pull Request #1016 · apache/arrow-java · GitHub

GH-139: [Flight] Stop return null from MetadataAdapter.getAll(String) and getAllByte(String) - #1016

Merged
jbonofre merged 2 commits into
apache:mainfrom
axreldable:call-headers-null
Feb 22, 2026
Merged

GH-139: [Flight] Stop return null from MetadataAdapter.getAll(String) and getAllByte(String)#1016
jbonofre merged 2 commits into
apache:mainfrom
axreldable:call-headers-null

Conversation

axreldable commented Feb 9, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

What's Changed

CallHeaders has 3 implementations:

  • FlightCallHeaders
  • ErrorFlightMetadata
  • MetadataAdapter

Before this change:
MetadataAdapter could return null from getAll(String) and getAllByte(String) when there were no values for the key, because gRPC’s Metadata.getAll() returns null in that case. This was undocumented and forced callers to null-check.

After this change:
All 3 implementations consistently return an empty iterable (never null) when the key is absent or has no values. The contract is documented on the interface and covered by tests for each implementation.


This contains breaking changes.
MetadataAdapter.getAll(String) and getAllByte(String) return empty iterator instead of null.


Closes #139.

This comment has been minimized.

Copy link
Copy Markdown
Contributor Author

Please add the enhancement label.

ennuite left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Hello @axreldable
This looks good to me, thank you for it.

I note that this also fixes an NPE in MetadataAdapter.getAllByte(String key)

lidavidm added the enhancement PRs that add or improve features. label Feb 10, 2026
github-actions Bot added this to the 19.0.0 milestone Feb 10, 2026

Copy link
Copy Markdown
Contributor Author

Hello @axreldable This looks good to me, thank you for it.

I note that this also fixes an NPE in MetadataAdapter.getAllByte(String key)

Correct, it fixes NPE for getAll(key).spliterator() in MetadataAdapter.getAllByte(String key) method.

jbonofre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Overall LGTM.
Can you just clarify the case when it is null in the ServerSessionMiddleware please ?

Copy link
Copy Markdown
Contributor Author

@jbonofre , some CI pipelines failed. Do you think it relates to the changes or the pipelines are flaky?

Copy link
Copy Markdown
Member

@axreldable let me take a look. I will get back to you.

Copy link
Copy Markdown
Member

The verify job failed to flaky test (memory allocation). I ran again the jobs to double check.

Copy link
Copy Markdown
Contributor Author

Thank you, @jbonofre ! Looks like tests passed this time.

jbonofre merged commit 6b6d16a into apache:main Feb 22, 2026
48 of 50 checks passed
axreldable deleted the call-headers-null branch February 26, 2026 21:08
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

Labels

breaking-change enhancement PRs that add or improve features.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Java][Docs] Undocumented null return from CallHeaders.getAll()

4 participants


Back | FazBrowse Home | New Git URL