Skip to content

Conversation

@findepi
Copy link
Member

@findepi findepi commented Oct 30, 2025

Summary by Sourcery

Document the behavior and error contracts for TrinoInput’s readFully and readTail methods

Enhancements:

  • Add detailed Javadoc for readFully(byte[]) and readTail(byte[]) methods including parameter validation and EOFException semantics
  • Document default Slice-returning readFully and readTail overloads

@findepi findepi added the no-release-notes This pull request does not require release notes entry label Oct 30, 2025
@cla-bot cla-bot bot added the cla-signed label Oct 30, 2025
@sourcery-ai

This comment was marked as off-topic.

sourcery-ai[bot]

This comment was marked as off-topic.

@findepi findepi force-pushed the findepi/document-trinoinput-contract-62e9aa branch 2 times, most recently from b0b769b to a64bfd7 Compare October 30, 2025 09:14
@findepi findepi removed the request for review from losipiuk October 30, 2025 09:16
Copy link
Member

@raunaqmorarka raunaqmorarka left a comment

Choose a reason for hiding this comment

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

lgtm % comments

*
* @param buffer the buffer to read bytes into; must be non-null
* @param bufferOffset the offset in the buffer to start writing bytes to; must be non-negative
* @param maxLength the maximum number of bytes to read; must be non-negative
Copy link
Member

Choose a reason for hiding this comment

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

Is maxLength allowed to be bigger than remaining space in buffer ?

Copy link
Member Author

Choose a reason for hiding this comment

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

i think it's not allowed

*
* @param buffer the buffer to read bytes into; must be non-null
* @param bufferOffset the offset in the buffer to start writing bytes to; must be non-negative
* @param maxLength the maximum number of bytes to read; must be non-negative
Copy link
Member

Choose a reason for hiding this comment

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

Is maxLength allowed to be bigger than file size ?

Copy link
Member Author

Choose a reason for hiding this comment

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

for readTail - i think it is allowed

* @param maxLength the maximum number of bytes to read; must be non-negative
* @return the number of bytes actually read, which may be less than {@code maxLength} if
* the input contains fewer bytes than {@code maxLength}
*/
Copy link
Member

Choose a reason for hiding this comment

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

@throws ?

Copy link
Member Author

Choose a reason for hiding this comment

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

omitted intentionally, i have no information to add beyond what's already in the method signature

@findepi findepi force-pushed the findepi/document-trinoinput-contract-62e9aa branch from a64bfd7 to 026398b Compare October 30, 2025 10:52
@findepi findepi force-pushed the findepi/document-trinoinput-contract-62e9aa branch from 026398b to e673a7e Compare October 30, 2025 12:58
@findepi findepi merged commit 91d456d into trinodb:master Nov 3, 2025
74 checks passed
@findepi findepi deleted the findepi/document-trinoinput-contract-62e9aa branch November 3, 2025 07:55
@github-actions github-actions bot added this to the 479 milestone Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed no-release-notes This pull request does not require release notes entry

Development

Successfully merging this pull request may close these issues.

4 participants