Skip to content

Restore DigitalRoot legacy API compatibility - #104

Closed
krotname wants to merge 1 commit into
mainfrom
codex/fix-digitalroot-api-rename-issue
Closed

Restore DigitalRoot legacy API compatibility#104
krotname wants to merge 1 commit into
mainfrom
codex/fix-digitalroot-api-rename-issue

Conversation

@krotname

@krotname krotname commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Fix a source/binary compatibility regression introduced by renaming the public kata method from digital_root(int) to digitalRoot(int) so existing callers and Codewars harnesses continue to work.

Description

  • Add a deprecated compatibility wrapper public static int digital_root(int n) that delegates to the existing digitalRoot(int) implementation to preserve a single centralized behavior.
  • Document the wrapper with Javadoc and mark it @Deprecated to encourage migration while retaining the old API.
  • Extend the parameterized test shouldReduceNumberToSingleDigit to assert the legacy method returns the same results as digitalRoot(int) and digitalRootRecursiveStream(int) for the existing test cases.

Testing

  • Ran unit tests with mvn -B -DskipTests=false test, and all tests passed (597 tests, 0 failures/errors).
  • Ran full verification with mvn -B verify, and the build succeeded with coverage thresholds met and no Checkstyle/PMD/SpotBugs issues.
  • The changes are minimal and purely API-compatible, with behavior delegated to the unchanged implementation so existing functionality is preserved.

Codex Task

Comment thread src/test/java/kyu6/DigitalRootTest.java
@krotname

krotname commented Aug 1, 2026

Copy link
Copy Markdown
Owner Author

Закрываю как superseded by #116: изменения перенесены в одну проверенную ветку, все review findings учтены; локальный mvn verify прошёл полностью.

@krotname krotname closed this Aug 1, 2026
@krotname
krotname deleted the codex/fix-digitalroot-api-rename-issue branch August 1, 2026 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants