Skip to content

Add a real JPMS module descriptor: com.github.zrdj.java.predicates - #19

Merged
glaudeee merged 2 commits into
mainfrom
feature/module-descriptor
Oct 18, 2026
Merged

glaudeee merged 2 commits into
mainfrom
feature/module-descriptor

Conversation

@glaudeee

Copy link
Copy Markdown
Contributor

What

Adds src/main/java/module-info.java declaring module com.github.zrdj.java.predicates, exporting all five packages (root, collections, helper, objects, primitives), with no requires. Version goes to 0.6.0.

helper looks internal, but Action and Throws are public and StringPredicates uses Throws, so it is exported to avoid breaking consumers who reach it on the classpath today.

Why

Without a descriptor or Automatic-Module-Name, JPMS derives java.predicates from the jar file name, which lands in the java.* namespace the JDK reserves. Same fix as ZrdJ/java-properties#18; part of one sweep over the zrdj libraries, triggered by tibbots/bots using them from JPMS modules.

Decision: .docs/project/decisions/2026-10-18-real-module-descriptor-instead-of-automatic-name.md.

Check

./dev check: 60 tests green. module-info.class is in the 0.6.0 jar.

🤖 Generated with Claude Code

Without a module-info.class or an Automatic-Module-Name entry, consumers on
the module path get the automatic name derived from the jar file name,
"java.predicates", which lies in the java.* namespace the JDK reserves for
platform modules. It works today only because classpath starts never
resolve the name.

Add module-info.java naming the module after its root package and exporting
all five packages, since every one of them is reachable on the classpath
today. The library has no non-test dependencies, so there is no requires
clause. The compiler plugin picks up the descriptor without further build
configuration; bump the version to 0.6.0 in pom.xml and the README, and
record the decision.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With module-info.java present, surefire 3.x (what CI's Maven resolves)
runs the tests on the module path and patches the test classes into the
module. The test-only package com.github.zrdj.java.predicates.testcases,
which holds the inherited @test methods, is not exported, so JUnit 4 in
the unnamed module failed with InaccessibleObjectException for five test
classes. The dev container's Maven defaulted to surefire 2.12.4, which
runs on the classpath, so the local build stayed green.

Pin maven-surefire-plugin to 3.6.0 so local and CI run the same way, and
open the testcases package to ALL-UNNAMED via argLine. The ADR records
the pin and its reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@glaudeee
glaudeee merged commit aed6b3d into main Oct 18, 2026
4 checks 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.

2 participants