hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [hadoop] steveloughran commented on a change in pull request #2297: HADOOP-17125. Using snappy-java in SnappyCodec
Date Mon, 05 Oct 2020 16:51:33 GMT

steveloughran commented on a change in pull request #2297:
URL: https://github.com/apache/hadoop/pull/2297#discussion_r499736294



##########
File path: hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/compress/CompressDecompressTester.java
##########
@@ -432,7 +412,11 @@ public void assertCompression(String name, Compressor compressor,
               joiner.join(name, "byte arrays not equals error !!!"),
               originalRawData, decompressOut.toByteArray());
         } catch (Exception ex) {
-          fail(joiner.join(name, ex.getMessage()));
+          if (ex.getMessage() != null) {
+            fail(joiner.join(name, ex.getMessage()));
+          } else {
+            fail(joiner.join(name, ExceptionUtils.getStackTrace(ex)));

Review comment:
       NPE is why toString() is what new code should do.
   Why don't we just `throw new AssertionError(name +ex, ex)`. That way, the stack trace doesn't
get lost, which is something we never want to have happen, 




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


Mime
View raw message