elharo opened a new issue, #144:
URL: https://github.com/apache/maven-shared-jar/issues/144
In `JarAnalyzer.java:52-56`:
```java
} catch (ZipException e) {
ZipException ioe = new ZipException("Failed to open file " + file + " :
" + e.getMessage());
ioe.initCause(e);
throw ioe;
}
```
Two issues:
1. The variable is named `ioe` but it is a `ZipException`, not an
`IOException`. This is misleading for maintainers.
2. The re-wrapping is redundant: the constructor already passes a message,
and `initCause` links the original. There is no benefit over just throwing `e`
directly, since no new information is added beyond what is already in the
original exception.
**Fix**: Either rethrow `e` directly, or at minimum rename the variable to
`ze`:
```java
} catch (ZipException e) {
throw e;
}
```
--
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]