You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gilles (JIRA)" <ji...@apache.org> on 2016/03/14 02:51:33 UTC
[jira] [Created] (MATH-1340) "serializeAndRecover" testing utility
swallows exceptions
Gilles created MATH-1340:
----------------------------
Summary: "serializeAndRecover" testing utility swallows exceptions
Key: MATH-1340
URL: https://issues.apache.org/jira/browse/MATH-1340
Project: Commons Math
Issue Type: Improvement
Reporter: Gilles
Assignee: Gilles
Priority: Trivial
Fix For: 4.0
Class {{TestUtils}} (in the "test" part of the repository) contains a "serializeAndRecover" method that catches "IOException" and "ClassNotFoundException" and just returns "null".
When testing code changes, some unit tests can thus throw "NullPointerException". Even if the returned value is checked for "null", there is no trace as to what caused it (the original stack trace is lost).
I propose to wrap the exception in a "RuntimeException" and rethrow it.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)