Skip to content

refactor: remove commons-math3 and commons-text - #152

Merged
mariuszs merged 2 commits into
masterfrom
refactor/remove-commons-math-text
Mar 14, 2026
Merged

refactor: remove commons-math3 and commons-text#152
mariuszs merged 2 commits into
masterfrom
refactor/remove-commons-math-text

Conversation

@mariuszs

Copy link
Copy Markdown
Member

Summary

  • Remove commons-math3 (2.2MB) — replace RandomDataGenerator/JDKRandomGenerator with java.util.Random
  • Remove commons-text (280KB) — replace StringEscapeUtils.escapeJava() with inline escapeNonAscii()
  • Net result: ~2.5MB fewer runtime dependencies

Test plan

  • All 1427 tests pass
  • Deterministic seeded output preserved (same seeds produce same results)

Replace RandomDataGenerator/JDKRandomGenerator with java.util.Random.
Replace StringEscapeUtils.escapeJava() with inline escapeNonAscii().
Removes ~2.5MB of runtime dependencies.
- Use Random.nextInt(origin, bound), nextLong(origin, bound),
  nextDouble(origin, bound) instead of hand-rolled algorithms
- Remove nextLongFromBytes() — JDK handles bounded longs natively
- Rename nextDouble(long, long) to nextLong(long, long)
- Move escapeNonAscii to TextUtils, use lowercase hex, add null guard
- Update seed-based test expectations
@mariuszs
mariuszs merged commit 00d0317 into master Mar 14, 2026
1 check passed
@mariuszs
mariuszs deleted the refactor/remove-commons-math-text branch March 15, 2026 17:07
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