Skip to content

Fix exact return-type matching and expand class-match tests - #148

Open
mcculls wants to merge 2 commits into
mainfrom
mcculls/class-match-behaviour-tests
Open

mcculls wants to merge 2 commits into
mainfrom
mcculls/class-match-behaviour-tests

Conversation

@mcculls

@mcculls mcculls commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

What Does This Do

Fix exact method return-type matching and expand class-match test coverage. Both returning(String) and returning(Class<?>) now include the closing parameter delimiter when matching a return descriptor, so a request for int no longer matches int[], and object names cannot match suffixes of other class names.

Add tests for class, field, method, type, access, and name matchers; signature overloads; annotations; composition and short-circuiting; and outline descriptor views. Exercise bytecode parsing with generated signatures checked against reflection, modified UTF-8, malformed input, byte-key collisions, and nested matcher unions. Verify annotation registration in fresh JVMs and concurrent workers, using shared outline and ASM fixtures.

Motivation

Protect matcher and parser behavior with broader regression coverage, including false positives in exact return-type matching.

Additional Notes

Validation: ./gradlew :class-match:check --no-configuration-cache passed using cached/up-to-date results, including tests on Java 8, 11, 17, 21, and 25, Spotless, and SpotBugs.

Contributor Checklist

  • Regression tests included.
  • Class-match checks pass locally.

Cover class, field, method, type, access, and name matchers, including
signature overloads, annotations, composition, short-circuiting, and
descriptor views. Share outline and ASM fixtures to keep tests concise.

Compare generated signatures against reflection, exercise modified UTF-8
and malformed input, and check annotation registration in fresh JVMs and
concurrent workers. Cover byte-key collisions and nested matcher unions.
@mcculls
mcculls marked this pull request as ready for review October 17, 2026 21:18
@mcculls
mcculls requested a review from a team as a code owner October 17, 2026 21:18
@mcculls
mcculls requested review from jbachorik and removed request for a team October 17, 2026 21:18

This branch has not been deployed

No deployments
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