Skip to content

Minor code refactoring changes#2778

Merged
ChristianMurphy merged 4 commits into
uPortal-Project:masterfrom
HimanshiVerma05:master
Mar 26, 2024
Merged

Minor code refactoring changes#2778
ChristianMurphy merged 4 commits into
uPortal-Project:masterfrom
HimanshiVerma05:master

Conversation

@HimanshiVerma05

Copy link
Copy Markdown
Contributor
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.

@ChristianMurphy ChristianMurphy left a comment

Copy link
Copy Markdown
Member

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
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