commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (MATH-1340) "serializeAndRecover" testing utility swallows exceptions
Date Fri, 22 Apr 2016 22:41:13 GMT

     [ https://issues.apache.org/jira/browse/MATH-1340?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Gilles resolved MATH-1340.
--------------------------
    Resolution: Fixed

Code merged into branch "develop".

> "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
>              Labels: debugging
>             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)

Mime
View raw message