GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Give every verifier a package and a unique class name by slachiewicz · Pull Request #585 · codehaus-plexus/modello

Conversation

@slachiewicz

@slachiewicz slachiewicz commented Aug 9, 2026

Copy link
Copy Markdown
Member

Stacked on #584 — review that first; the base moves to master when it merges.

Ten verifiers sat in the default package, and three names were used twice:

  • four classes called JavaVerifier, under features/, bidirectional/, features-version/ and java/
  • StaxFeaturesVerifier under both features/ and features-dom/, in the same package
  • Xpp3FeaturesVerifier, likewise

That only works because each verifierId directory is compiled on its own and loaded through its own classloader with a null parent, so the duplicates never meet. The cost is that verifyCompiledGeneratedSources("JavaVerifier") gave no indication which of the four it meant, and the directories could never be looked at together by anything.

The java and converters verifiers move to org.codehaus.modello.generator.{java,converters}, matching what dom4j, jackson, sax, stax, jdom and xpp3 already do, and the duplicated names take a prefix naming the model they verify (FeaturesJavaVerifier, BidirectionalJavaVerifier, FeaturesVersionJavaVerifier, StaxFeaturesDomVerifier, Xpp3FeaturesDomVerifier). Every lookup in the tests now spells out the fully-qualified name.

What this does not do: it does not make src/test/verifiers compilable at build time. The verifiers assert against classes that do not exist until the generator under test has run — features/JavaVerifier alone imports 21 generated types — so the runtime compile stays. The point is narrower: the names no longer rely on the isolation to keep from clashing.

Verification

mvn install with tests: exit 0, 120 tests, zero failures and zero errors across all 14 modules. spotless:check clean. Checked separately that no two verifiers share a fully-qualified name any more.

Note on the command: use install or verify, not mvn test. Under mvn test this repo reports 5 NullPointerExceptions on any branch including master, because getModelloVersion() reads a pom.properties that maven-archiver only writes at package time — see my comment on #584.

Draft until CI confirms.

Generated-by: Claude Opus 5 (1M context)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@slachiewicz slachiewicz mentioned this pull request Aug 9, 2026
Explain why src/test/verifiers is not a source root #586
Merged
@slachiewicz slachiewicz added java Pull requests that update Java code maintenance Cleanup, refactoring or other internal change labels Aug 9, 2026
@slachiewicz
Compile the verifiers with the JDK compiler and the test classpath
0ae8b21
The verifier compilation kept its own idea of the classpath. Every jar it
needed had to be copied into target/test-libs by a copy-dependencies
execution with stripVersion on, and then named again, by hand, in
addDependency calls - a handful inside the harness and twenty-six more
spread across the plugin tests.

That is a second source of truth for something the POM already states, and
it drifts: the harness was still adding junit:junit long after nothing
needed it. stripVersion also flattens two artifacts that share an
artifactId into one file name, silently.

The compilation now runs on the module's own test classpath, obtained from
the running JVM, so it is whatever the POM declares and nothing else.
Surefire hands a forked JVM a manifest-only jar rather than a real
classpath, so entries listed in a jar's Class-Path manifest attribute are
expanded as well as kept. The isolated classloader that runs the verifier
is fed the same list, since it has no parent to fall back on.

Compiling through javax.tools rather than plexus-compiler drops two more
dependencies; the JDK has shipped that interface since Java 6. Source and
target levels are unchanged.

Removes: the copy-test-libs execution, plexus-compiler-api,
plexus-compiler-javac, addDependency, getDependencyFile, getClasspath and
the tests.lib.dir property.

Generated-by: Claude Opus 5 (1M context)
@slachiewicz
slachiewicz force-pushed the agent/jsr199-verifier-compile branch from 6648585 to 0ae8b21 Compare August 9, 2026 23:13
@slachiewicz
Give every verifier a package and a unique class name
2586464
Ten verifiers sat in the default package, and three names were used twice:
four classes called JavaVerifier, and a StaxFeaturesVerifier and an
Xpp3FeaturesVerifier that collided inside the package they already shared.

That worked only because each verifierId directory is compiled on its own
and loaded through its own classloader. It also meant a caller asking for
"JavaVerifier" gave no clue which of the four it wanted, and that the
directories could never be looked at together by anything.

The java and converters verifiers move into
org.codehaus.modello.generator.{java,converters}, following what the other
plugins already do, and the duplicated names gain the prefix that says
which model they verify. The lookups in the tests spell out the full name.

This does not make the tree compilable at build time - the verifiers assert
against classes that do not exist until the generator has run - but the
names no longer depend on the isolation to stay apart.

Generated-by: Claude Opus 5 (1M context)
@slachiewicz
slachiewicz force-pushed the agent/verifier-unique-names branch from cef6781 to 2586464 Compare August 9, 2026 23:15
@slachiewicz slachiewicz mentioned this pull request Aug 9, 2026
Compile the verifiers with the JDK compiler and the test classpath #584
Merged
@slachiewicz
slachiewicz marked this pull request as ready for review August 9, 2026 23:22
Base automatically changed from agent/jsr199-verifier-compile to master August 9, 2026 23:23
@slachiewicz
slachiewicz merged commit 1624bf0 into master Aug 9, 2026
12 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@slachiewicz
slachiewicz deleted the agent/verifier-unique-names branch August 9, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

java Pull requests that update Java code maintenance Cleanup, refactoring or other internal change

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@slachiewicz
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.