Repository navigation
Ignore JVM array descriptors when packaging HiveMQ extensions - #12168
Conversation
Pre-merge checks:
|
| Check name | Status | Explanation |
|---|---|---|
| New Module Registration | The check applies only when the PR adds a new directory directly under modules/. The PR (#12168, author kiview) does not add one. Its diff against the merge base 597f59c touches only existing modules… |
|
| Public Api Compatibility | The check fails only when the PR removes, renames, or changes the signature, return type, or visibility of a public or protected class, method, constructor, or field under src/main/java without a depr… | |
| Tests For Behaviour Changes | The PR changes behaviour in production code. In modules/hivemq/src/main/java/org/testcontainers/hivemq/HiveMQExtension.java, the filter at line 155 changed from startsWith("[L") to `startsWith("["… |
Full details: New Module Registration
-
Explanation
The check applies only when the PR adds a new directory directly under modules/. The PR (
#12168, author kiview) does not add one. Its diff against the merge base 597f59c touches only existing modules: modules/hivemq (HiveMQExtension.java, ContainerWithExtensionSubclassIT.java, and the added test class PrimitiveArrayClass.java) and modules/localstack (two test files). The added file under modules/hivemq/src/test/java/.../hivemq/util/ sits inside the existing hivemq module, so it does not create a module. Because the check does not apply, the registration items (issue templates, dependabot, labeler, docs page, mkdocs nav) are not evaluated.
Full details: Public Api Compatibility
-
Explanation
The check fails only when the PR removes, renames, or changes the signature, return type, or visibility of a public or protected class, method, constructor, or field under src/main/java without a deprecated replacement. Commit e6100f9, the PR head, touches three files. Its only change under src/main/java is in modules/hivemq/src/main/java/org/testcontainers/hivemq/HiveMQExtension.java, where the condition
startsWith("[L")becomesstartsWith("[")inside the private methodputSubclassesIntoJar(line 140). No signature, return type, visibility, or public or protected member changes. The other two files, ContainerWithExtensionSubclassIT.java and the new PrimitiveArrayClass.java, are under src/test/java and are outside the check's scope. The check is therefore satisfied and no public API is affected.
Full details: Tests For Behaviour Changes
-
Explanation
The PR changes behaviour in production code. In
modules/hivemq/src/main/java/org/testcontainers/hivemq/HiveMQExtension.java, the filter at line 155 changed fromstartsWith("[L")tostartsWith("["). This is a bug fix: primitive array descriptors such as[Bno longer reachJavaArchive.addClass, which raised aPatternSyntaxException. The PR also adds a regression test undersrc/test(the module'smodules/hivemq/src/test/javatree).ContainerWithExtensionSubclassITnow calls.addAdditionalClass(PrimitiveArrayClass.class).PrimitiveArrayClasscasts anObjecttobyte[], which places[Bin the constant pool. The test therefore exercises the changed filter path. The check'ssrc/main/javaandsrc/testpaths map to the module-scoped paths in this repository. The test is an integration test that needs Docker. It is still a test undersrc/testthat exercises the change, so the check passes. I did not run the test, because the build toolchain is unavailable in this sandbox.
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Takes over #11928 by @sci-jvm-study, whose fork branch doesn't allow maintainer edits. It keeps their original commit and authorship, cherry-picked onto current
main. Supersedes #11928 and its duplicate #12157.Fixes #10074.
What does this PR do?
HiveMQExtension.putSubclassesIntoJarcollects class names from Javassist's constant pool and passes them toJavaArchive.addClass(String). It only skipped object array descriptors ([L...). However,ConstPool#getClassNames()also returns primitive array descriptors such as[Band multi-dimensional ones such as[[Ljava.lang.String;. These aren't class names, soaddClassfailed with aPatternSyntaxException.The fix skips every JVM array descriptor by checking for
[instead of[L.Changes
ContainerWithExtensionSubclassITaddsPrimitiveArrayClass, whose byte-array cast puts[Binto its constant pool. The test fails without the fix.Testing
Full GitHub Actions CI is green on this branch, including
:testcontainers-hivemq:check.🤖 Generated with Claude Code
https://claude.ai/code/session_015e4ZbYTmY9fpibo9mwk7Ps