Skip to content

removed duplicate validation and initialization logic in constructors - #1761

Open
jitokim wants to merge 1 commit into
spring-projects:mainfrom
jitokim:refactor/constructor-overloading
Open

jitokim wants to merge 1 commit into
spring-projects:mainfrom
jitokim:refactor/constructor-overloading

Conversation

@jitokim

@jitokim jitokim commented Nov 19, 2024

Copy link
Copy Markdown
Contributor

centralized constructor for improving code readability and maintainability by centralizing logic.


verified the changes using debugging with breakpoints to ensure correct constructor delegation and initialization logic.

image

test case to confirm that the functionality remains consistent and correct after refactoring.

image

@jitokim
jitokim force-pushed the refactor/constructor-overloading branch from e96ce13 to a39ae35 Compare November 19, 2024 13:22
@jitokim

jitokim commented Dec 14, 2024

Copy link
Copy Markdown
Contributor Author

@ilayaperumalg Hi, could you please review my PR ?

@jitokim
jitokim force-pushed the refactor/constructor-overloading branch from a39ae35 to bf0685d Compare October 12, 2025 16:19
The EncodingType constructor repeated the validation and field
initialization of the TokenCountEstimator constructor. It now
delegates to that constructor, and the EncodingType null check moves
into a small factory method so the error message stays the same.

Add a test for the argument validation of the EncodingType
constructor.

Signed-off-by: jitokim <pigberger70@gmail.com>
@jitokim
jitokim force-pushed the refactor/constructor-overloading branch from bf0685d to 2761f7a Compare November 26, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants