-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Conversation
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
There was a problem hiding this 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. |
...-file-share/src/main/java/com/azure/storage/file/share/models/ShareFileSymbolicLinkInfo.java
Show resolved
Hide resolved
...m/azure/storage/file/share/implementation/accesshelpers/ShareFileSymbolicLinkInfoHelper.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 🚢
/check-enforcer override |
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.