elharo opened a new issue, #135:
URL: https://github.com/apache/maven-shared-jar/issues/135

   In `JarVersionedRuntimes.java:47-49`:
   
   ```java
   public JarClasses getJarClasses(Integer version) {
       return versionedRuntimeMap.get(version).getJarClasses();  // NPE if 
version absent
   }
   ```
   
   If the requested `version` is not a key in the map, `get(version)` returns 
`null`, then `.getJarClasses()` throws a NullPointerException. This is 
inconsistent with `getJarVersionedRuntime()` on the same class, which safely 
returns `null` for missing keys. Any caller querying a non-existent version 
will crash.
   
   **Fix**: Guard against null, e.g.:
   ```java
   JarVersionedRuntime runtime = versionedRuntimeMap.get(version);
   return runtime != null ? runtime.getJarClasses() : null;
   ```


-- 
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