Clickin opened a new pull request, #837:
URL: https://github.com/apache/commons-compress/pull/837

   JIRA: https://issues.apache.org/jira/browse/COMPRESS-634
   
   Packing a JAR that contains `module-info.class` fails with 
`UnsupportedOperationException: Module requires ASM6` from 
`Segment.processClasses`. Raising the ASM API level alone doesn't help, because 
Pack200 has no bands for Module attributes.
   
   - `Archive.addJarEntry` now registers a class with `ACC_MODULE` as a pass 
file, so the descriptor is stored byte for byte. `Segment.processClasses` 
already does this for a class with an attribute whose action is "pass".
   - `PackingOptions.isPassFile` returned the result for the first directory 
entry, so a configured pass directory hid every pass entry added after it, 
including the descriptor above. It now checks all entries.
   
   There is no ASM upgrade and no public API change. Not addressed: on JDK 17, 
unpacking directly from a `FileInputStream` hits the reflection problem tracked 
in COMPRESS-721 (PR #764).
   
   `ArchiveTest.testModuleInfo` packs and unpacks a JAR with a module 
descriptor and one ordinary class, then checks that the descriptor bytes are 
identical and the class is present. Its 8 cases vary the descriptor location 
(root, `META-INF/versions/9/`), the input (`JarFile`, `JarInputStream`), the 
segment limit (-1, 0) and an unrelated pass directory. On master, the four 
cases without a pass directory fail with "Module requires ASM6". The four with 
one still fail without the `isPassFile` fix.
   
   The default `mvn` build passes on JDK 17, and `mvn clean test` passes on JDK 
8.
   
   - [x] Read the [contribution guidelines](CONTRIBUTING.md) for this project.
   - [x] Read the [ASF Generative Tooling 
Guidance](https://www.apache.org/legal/generative-tooling.html) if you use 
Artificial Intelligence (AI).
   - [x] I used AI to create any part of, or all of, this pull request. Which 
AI tool was used to create this pull request, and to what extent did it 
contribute?
     OpenAI GPT-6 Astra wrote the change and the tests; Claude Opus 5.5 
reviewed them and wrote this description. The commit carries `Generated-by` and 
`Assisted-By` trailers.
   - [x] Run a successful build using the default 
[Maven](https://maven.apache.org/) goal with `mvn`; that's `mvn` on the command 
line by itself.
   - [x] Write unit tests that match behavioral changes, where the tests fail 
if the changes to the runtime are not applied. This may not always be possible, 
but it is a best practice.
   - [x] Write a pull request description that is detailed enough to understand 
what the pull request does, how, and why.
   - [x] Each commit in the pull request should have a meaningful subject line 
and body. Note that a maintainer may squash commits during the merge process.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to