Skip to content

Conversation

@Nakul-Shivaraj
Copy link
Contributor

@Nakul-Shivaraj Nakul-Shivaraj commented Nov 18, 2025

Closes #14346

Added final modifier and private constructor to StaxParser utility class to prevent instantiation and subclassing, following Java best practices for utility classes containing only static methods.

@espertusnu - This addresses the utility class refactoring discussed on Gitter.

Steps to test

  1. Build the project: ./gradlew build
  2. Run existing tests: ./gradlew test
  3. Verify all tests pass - no functionality should be affected

Mandatory checks

@koppor koppor added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Nov 18, 2025
@InAnYan
Copy link
Member

InAnYan commented Nov 18, 2025

Oh wait, you created a separate PR for each class?

Maybe, this is a requirement from your class? I, just, believe that doing everything in 1 PR would be faster to process and review

@InAnYan
Copy link
Member

InAnYan commented Nov 18, 2025

Sorry, Nakul.

I have read the discussion on Gitter right now, and now I understood why there are separate PRs.

Okay, everything's fine from your side! But I believe it's better to change the error message to something more specific

@Nakul-Shivaraj
Copy link
Contributor Author

Hi @InAnYan,

No worries!! I've updated the exception message to "Cannot instantiate a utility class" as you suggested. Thank you for the feedback!

All 6 PRs now have the updated, more specific error message.

@Siedlerchr Siedlerchr enabled auto-merge November 19, 2025 13:07
@Siedlerchr Siedlerchr added this pull request to the merge queue Nov 19, 2025
Merged via the queue into JabRef:main with commit fb24774 Nov 19, 2025
49 checks passed
@github-actions github-actions bot mentioned this pull request Nov 19, 2025
merlinymy pushed a commit to merlinymy/jabref that referenced this pull request Nov 19, 2025
* Add final modifier and private constructor

* Update exception message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code Refactoring

4 participants