Skip to content

Drop jibx-tools dependency to remove transitive log4j 1.x#8

Merged
merlimat merged 1 commit into
streamnative:masterfrom
merlimat:drop-jibx-dependency
May 12, 2026
Merged

Drop jibx-tools dependency to remove transitive log4j 1.x#8
merlimat merged 1 commit into
streamnative:masterfrom
merlimat:drop-jibx-dependency

Conversation

@merlimat
Copy link
Copy Markdown
Collaborator

Summary

  • jibx-tools 1.3.3 was used only in Util.plural / Util.singular to derive accessor names for repeated fields (addItem, getItemsCount, etc.). It transitively pulled in log4j 1.2.17 (multiple CVEs) and ~10 ancient Eclipse JDT jars.
  • The relevant pluralize / depluralize logic from JiBX NameUtilities is ~40 lines of rule-based suffix manipulation with no irregular-plural handling. Vendored it directly into Util.java (BSD 3-clause, attribution in comment). Generated output is byte-identical to before.
  • Added UtilTest covering every branch of plural / singular, including a case-sensitivity quirk in the original jibx implementation where "ANY" pluralizes to "ANYs".

After this change, mvn dependency:tree for code-generator no longer contains log4j, jibx, or org.eclipse.*.

Test plan

  • mvn install builds clean across all modules
  • All 262 existing tests in lightproto-tests pass unchanged (these exercise plural/singular for every repeated field in the proto fixtures)
  • New UtilTest (34 cases) covers every branch of plural and singular
  • mvn -pl code-generator dependency:tree shows no log4j, jibx, or Eclipse JDT artifacts

jibx-tools was only used in Util.plural / Util.singular to derive
accessor names for `repeated` fields (addItem / getItemsCount / etc.).
It transitively pulled in log4j 1.2.17 (multiple CVEs) and ~10 ancient
Eclipse JDT jars.

The relevant pluralize/depluralize logic from JiBX NameUtilities is
~40 lines of rule-based suffix manipulation with no irregular-plural
handling, so vendor it directly into Util (BSD 3-clause, attribution
in comment). Generated output is byte-identical; all 262 existing
tests pass unchanged.

Add UtilTest covering every branch of plural / singular, including
the case-sensitivity quirk in jibx where "ANY" pluralizes to "ANYs".
@merlimat merlimat merged commit 923427f into streamnative:master May 12, 2026
1 check passed
@merlimat merlimat deleted the drop-jibx-dependency branch May 12, 2026 20:35
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