Skip to content

Ignore JVM array descriptors when packaging HiveMQ extensions - #11928

Closed
sci-jvm-study wants to merge 1 commit into
testcontainers:mainfrom
sci-jvm-study:fix-hivemq-array-descriptor
Closed

sci-jvm-study wants to merge 1 commit into
testcontainers:mainfrom
sci-jvm-study:fix-hivemq-array-descriptor

Conversation

@sci-jvm-study

Copy link
Copy Markdown

What does this PR do?

Fixes #10074.

'HiveMQExtension' currently ignores only object array descriptors ('[L') when collecting classes from Javassist's constant pool.

However, 'ConstPool#getClassNames()' may also return primitive array descriptors such as '[B'. These are JVM descriptors rather than fully qualified class names, so passing them to 'JavaArchive.addClass(String)' results in a 'PatternSyntaxException'.

This change ignores all JVM array descriptors by checking for '[' instead of only '[L'.

Changes

  • Ignore all JVM array descriptors returned from the constant pool when packaging additional classes
  • Add a regression test covering a primitive array descriptor ('[B')
  • Add a helper test class that generates a primitive array descriptor in the constant pool

Testing

  • Reproduced the reported 'PatternSyntaxException' before the fix
  • Verified that the regression test fails with the original implementation
  • Verified that the regression test passes after the fix

@sci-jvm-study
sci-jvm-study requested a review from a team as a code owner July 15, 2026 10:38
kiview added a commit that referenced this pull request Nov 15, 2026
HiveMQExtension only skipped object array descriptors ("[L") from the Javassist constant pool. Primitive and multi-dimensional array descriptors such as "[B" were passed to JavaArchive.addClass and failed with a PatternSyntaxException. Skip every array descriptor instead, and add a regression test.

Takes over #11928.

Fixes #10074

Co-authored-by: Dhawaj Kumar Tomar <dhawaj@tritv65.com>
@kiview kiview closed this Nov 15, 2026
@kiview

kiview commented Nov 15, 2026

Copy link
Copy Markdown
Member

Thanks @sci-jvm-study, I took this into #12168, since CI was hanging here, but kept your commit and authorship.

@sci-jvm-study

sci-jvm-study commented Nov 18, 2026 •

Copy link
Copy Markdown
Author

Thanks @sci-jvm-study, I took this into #12168, since CI was hanging here, but kept your commit and authorship.

Thanks @kiview for taking care of this. Happy to contribute more to the project. Looking forward to working on more issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: HiveMQExtension / Class Loading Issue

2 participants