Repository navigation
Add a real JPMS module descriptor: com.github.zrdj.java.predicates - #19
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
src/main/java/module-info.javadeclaringmodule com.github.zrdj.java.predicates, exporting all five packages (root,collections,helper,objects,primitives), with norequires. Version goes to 0.6.0.helperlooks internal, butActionandThrowsare public andStringPredicatesusesThrows, so it is exported to avoid breaking consumers who reach it on the classpath today.Why
Without a descriptor or
Automatic-Module-Name, JPMS derivesjava.predicatesfrom the jar file name, which lands in thejava.*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.classis in the 0.6.0 jar.🤖 Generated with Claude Code