Skip to content

Do small improvements related to value-based classes#1964

Merged
stIncMale merged 1 commit intomongodb:mainfrom
stIncMale:smallValueBasedImprovements
May 7, 2026
Merged

Do small improvements related to value-based classes#1964
stIncMale merged 1 commit intomongodb:mainfrom
stIncMale:smallValueBasedImprovements

Conversation

@stIncMale
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR makes small internal refinements related to “value-based” classes by tightening test visibility in TimePoint and simplifying AttachmentKey instantiation via a factory method.

Changes:

  • Annotate TimePoint’s constructor as @VisibleForTesting(otherwise = PRIVATE) to clarify intended access outside tests.
  • Replace direct new DefaultAttachmentKey<>(...) construction with a DefaultAttachmentKey.of(...) factory.
  • Add a “value-based” class Javadoc note to DefaultAttachmentKey.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
driver-core/src/main/com/mongodb/internal/time/TimePoint.java Marks constructor as visible-for-testing to better document intended encapsulation.
driver-core/src/main/com/mongodb/internal/operation/retry/AttachmentKeys.java Introduces a factory method for DefaultAttachmentKey and adds value-based documentation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread driver-core/src/main/com/mongodb/internal/operation/retry/AttachmentKeys.java Outdated
@stIncMale stIncMale force-pushed the smallValueBasedImprovements branch from 332f5ab to 6149c85 Compare May 6, 2026 18:10
@stIncMale stIncMale requested a review from Copilot May 6, 2026 18:10
@stIncMale stIncMale marked this pull request as ready for review May 6, 2026 18:55
@stIncMale stIncMale requested a review from a team as a code owner May 6, 2026 18:55
@stIncMale stIncMale requested review from Copilot, rozza and vbabanin and removed request for Copilot and rozza May 6, 2026 18:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@stIncMale stIncMale merged commit 91c312c into mongodb:main May 7, 2026
61 checks passed
@stIncMale stIncMale deleted the smallValueBasedImprovements branch May 7, 2026 00:28
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