Skip to content

fix(sax): add private constructors to utility classes and fix Javadoc#24

Merged
marevol merged 1 commit intomasterfrom
fix/utility-class-constructors-and-javadoc
Mar 12, 2026
Merged

fix(sax): add private constructors to utility classes and fix Javadoc#24
marevol merged 1 commit intomasterfrom
fix/utility-class-constructors-and-javadoc

Conversation

@marevol
Copy link
Collaborator

@marevol marevol commented Mar 12, 2026

Summary

Code quality fixes for utility classes and Javadoc generation in the sax package.

Changes Made

  • EncodingMap.java: Added private constructor to prevent instantiation — EncodingMap is a static utility class and should not be instantiated
  • XMLChar.java: Same utility class fix — added private constructor
  • SimpleHTMLScanner.java: Added explicit public no-arg constructor to satisfy Javadoc strict mode; also fixed an inline code reference in Javadoc (&not={@code &not=, &copy=})
  • pom.xml: Enabled <legacyMode>true</legacyMode> in maven-javadoc-plugin to resolve Javadoc generation issues with newer JDK
  • EncodingMapTest.java: Removed testConstructor() which tested public instantiation of what is now a non-instantiable utility class

Testing

The removed test was validating behavior (instantiability) that is now intentionally prohibited. All remaining tests cover the static API surface, which is unaffected.

Breaking Changes

None — EncodingMap and XMLChar were not meant to be instantiated; this change enforces that contract. SimpleHTMLScanner retains its public constructor.

Additional Notes

These changes align with standard Java utility class conventions and static analysis tool expectations (e.g., SonarQube HideUtilityClassConstructor rule).

- Add private constructor to EncodingMap and XMLChar to prevent
  instantiation of utility classes (Sonar/checkstyle compliance)
- Add explicit public constructor to SimpleHTMLScanner to satisfy
  Javadoc strict mode
- Fix Javadoc inline code tag: &not=, &copy= → {@code &not=, &copy=}
- Enable legacyMode in maven-javadoc-plugin to fix Javadoc generation
- Remove EncodingMapTest#testConstructor that tested public instantiation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@marevol marevol merged commit c9b34d8 into master Mar 12, 2026
1 check 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.

1 participant