elharo opened a new pull request, #157: URL: https://github.com/apache/maven-shared-jar/pull/157
Fixes #135 `JarVersionedRuntimes.getJarClasses(Integer version)` called `versionedRuntimeMap.get(version).getJarClasses()`, which throws a `NullPointerException` when the requested version is not a key in the map. This is inconsistent with `getJarVersionedRuntime()`, which safely returns `null` for missing keys. This change guards against a missing key and returns `null`, matching the documented behaviour of the sibling accessor. Added a unit test `JarVersionedRuntimesTest` that reproduces the NPE (fails before the fix, passes after): - `getJarClassesForExistingVersion` verifies the existing key still returns the expected `JarClasses` - `getJarClassesForMissingVersionReturnsNull` verifies a missing version returns `null` instead of throwing -- 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]
