Skip to content
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

Minor code refactoring changes #2778

Merged
merged 4 commits into from
Mar 26, 2024
Merged

Minor code refactoring changes #2778

merged 4 commits into from
Mar 26, 2024

Conversation

HimanshiVerma05
Copy link

Checklist
  • the [individual contributor license agreement][] is signed
  • commit message follows [commit guidelines][]
  • tests are included
Description of change

This PR includes minor code refactoring changes -
Introduce Explaining Variables: To make code more readable I have introduced variables.
Decompose Complex Condition: Decomposed complex if condition to make it more readable
Use Constructor Injection: Instead of using setter injection for usernameAttributeProvider and personAttributeDao, you can use constructor injection. This ensures that the dependencies are injected when the object is created and makes the class immutable.
Extract Method for Query Transformation: The switch statement that modifies the query based on the search method can be extracted into a separate method for better readability and maintainability.
Use Diamond Operator: When creating instances of collections, you can use the diamond operator (<>) to reduce redundant type declarations.

Copy link
Member

@ChristianMurphy ChristianMurphy left a comment

Choose a reason for hiding this comment

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

@ChristianMurphy ChristianMurphy merged commit 9bc3f60 into uPortal-Project:master Mar 26, 2024
8 checks passed
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.

None yet

2 participants