Copilot commented on code in PR #178:
URL: https://github.com/apache/maven-shared-jar/pull/178#discussion_r4234737687
##########
src/test/java/org/apache/maven/shared/jar/classes/JarClassesAnalyzerTest.java:
##########
@@ -346,6 +352,55 @@ void analyzeMultiReleaseJarResourcesOnly() {
"It should not raise an exception");
}
+ @Test
+ void analyzeMultiReleaseJarWithoutRootClassEntries() throws Exception {
+ File jarFile = File.createTempFile("multi-release-no-root", ".jar");
+ try {
+ try (JarFile sourceJar = new
JarFile(getSampleJar("helloworld-9.jar"));
+ JarOutputStream output =
+ new JarOutputStream(new FileOutputStream(jarFile),
multiReleaseManifest())) {
Review Comment:
This fixture does not reproduce the missing-`ROOT` case. The
`JarOutputStream(OutputStream, Manifest)` constructor writes
`META-INF/MANIFEST.MF`, and `jarEntryVersion` classifies that entry as `ROOT`,
so `runtimeVersionsMap.remove(ROOT)` is non-null and this test already passes
with the current unconditional dereference in `JarClassesAnalysis`. Please
exercise a genuinely absent root mapping and add the production null handling;
otherwise issue #138 remains unfixed and the regression test cannot detect it.
--
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]