efegokdemir commented on code in PR #177:
URL: https://github.com/apache/maven-shared-jar/pull/177#discussion_r4155376802
##########
src/main/java/org/apache/maven/shared/jar/identification/exposers/RepositorySearchExposer.java:
##########
@@ -77,9 +83,11 @@ public void expose(JarIdentification identification,
JarAnalyzer jarAnalyzer) {
repohits.addAll(repositoryHashSearch.searchFileHash(hash));
}
- String bytecodehash = bytecodeHashAnalyzer.computeHash(jarAnalyzer);
- if (bytecodehash != null) {
-
repohits.addAll(repositoryHashSearch.searchBytecodeHash(bytecodehash));
+ try {
+ String bytecodeHash =
bytecodeHashAnalyzer.computeHashCode(jarAnalyzer);
+
repohits.addAll(repositoryHashSearch.searchBytecodeHash(bytecodeHash));
+ } catch (IOException e) {
+ logger.warn("Unable to calculate the bytecode hash.", e);
Review Comment:
Fixed in 1ede980: RepositorySearchExposer no longer catches and logs the
checked IOException while continuing. It throws UncheckedIOException at the
exposer boundary, preserving the original IOException as its cause; the new
regression test verifies the caller receives it. This keeps the existing expose
API source-compatible while making the I/O failure actionable.
--
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]