Skip to content

Making ShareFileSymbolicLinkInfo Package Private #45512

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

Merged
merged 1 commit into from
Jun 2, 2025

Conversation

ibrandes
Copy link
Contributor

Addresses API View comment.

While other models in File Share may not follow this pattern, many of the older models exposed public constructors even when it wasn’t necessary. In contrast, we can make the constructor for ShareFileSymbolicLinkInfo internal. This allows us to avoid adding new public constructor overloads every time a property is added in the future—something that has led to bloated Blob models.

@github-actions github-actions bot added the Storage Storage Service (Queues, Blobs, Files) label May 28, 2025
Copy link
Contributor

API Change Check

APIView identified API level changes in this PR and created the following API reviews

com.azure:azure-storage-file-share

@ibrandes ibrandes marked this pull request as ready for review May 28, 2025 20:25
@Copilot Copilot AI review requested due to automatic review settings May 28, 2025 20:25
Copy link
Contributor

@Copilot 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 modifies the ShareFileSymbolicLinkInfo model to restrict its public API by making its parameterized constructor package-private while retaining a default constructor for internal use. The changes aim to prevent API bloat from additional public constructors and update dependent code to use an accessor pattern for instance creation.

  • Made the parameterized constructor package-private in ShareFileSymbolicLinkInfo.java and added a static block for accessor registration.
  • Updated ModelHelper.java to utilize the new helper method for constructing ShareFileSymbolicLinkInfo.
  • Introduced ShareFileSymbolicLinkInfoHelper.java to encapsulate internal instance creation.

Reviewed Changes

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

File Description
sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareFileSymbolicLinkInfo.java Modified constructor visibility and added a default constructor and static accessor registration.
sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/util/ModelHelper.java Replaced direct instantiation with the helper method call.
sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/accesshelpers/ShareFileSymbolicLinkInfoHelper.java Introduced new helper to support internal creation via accessor registration.

Copy link
Member

@kyleknap kyleknap left a comment

Choose a reason for hiding this comment

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

Looks good! 🚢

@ibrandes
Copy link
Contributor Author

ibrandes commented Jun 2, 2025

/check-enforcer override

@ibrandes ibrandes merged commit 35bbe28 into Azure:main Jun 2, 2025
36 of 38 checks passed
@ibrandes ibrandes deleted the storage/APIViewCommentSTG98GA branch June 2, 2025 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants