Skip to content

Conversation

@pathob
Copy link
Contributor

@pathob pathob commented Jul 20, 2025

No description provided.

@pathob pathob requested a review from Copilot July 20, 2025 01:54
Copy link

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 modernizes the codebase by consistently replacing manual object instantiation and setter calls with Lombok's builder pattern across all model classes. The migration improves code readability, reduces boilerplate, and ensures thread-safe object construction.

Key changes include:

  • Replaced @NoArgsConstructor and @AllArgsConstructor with @Builder or @SuperBuilder for inheritance
  • Updated all object creation from new Model() + setters to Model.builder().field(value).build()
  • Modernized static example instances to use builder pattern

Reviewed Changes

Copilot reviewed 95 out of 95 changed files in this pull request and generated 7 comments.

File Description
Model classes (commons) Added @Builder/@SuperBuilder annotations and updated example instances
Service implementations Replaced object instantiation with builder pattern usage
Test classes Updated test object creation to use builders
Utility classes Modernized model creation in utility methods

DirectoryDelegatingModel directoryDelegatingModel = (DirectoryDelegatingModel) directoryModel;
directoryDelegatingModel.setPermissions(permissions);
// Only set permissions if the builder supports it
if (builder instanceof DirectoryInternalModel.DirectoryInternalModelBuilder) {
Copy link

Copilot AI Jul 20, 2025

Choose a reason for hiding this comment

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

Using instanceof checks on builder types is fragile and breaks the abstraction. Consider using method overloading or a more robust polymorphic approach to handle different directory types.

Copilot uses AI. Check for mistakes.
@pathob pathob force-pushed the builders branch 2 times, most recently from 5451600 to e2b55f6 Compare July 21, 2025 07:54
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)
5.3% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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.

2 participants