-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Several utility classes in the codebase contain only static methods but lack both the final modifier and a private constructor to prevent instantiation and subclassing. This violates Java best practices for utility classes and could lead to misuse.
Add the final modifier to each utility class declaration and include a private constructor that throws UnsupportedOperationException to explicitly prevent instantiation. This follows the standard pattern recommended in "Effective Java" by Joshua Bloch.
Affected classes:
org.jabref.logic.icore.ConferenceUtilsorg.jabref.logic.ai.util.CitationKeyCheckorg.jabref.logic.importer.util.StaxParserorg.jabref.logic.importer.util.JsonReaderorg.jabref.logic.importer.util.MathMLParserorg.jabref.logic.git.merge.planning.util.ConflictRules
This refactoring has no behavioral changes and improves code quality by making the intent of these utility classes explicit. Each class will be addressed in a separate pull request for easier review.
This was discussed and approved on Gitter by @koppor .